Commit Detail
Commit 97cd88f
fix: add Performance.toJSON() and make setResourceTimingBufferSize() a no-op Add toJSON() method to the Performance class, returning an object with timeOrigin to match the W3C spec and Node.js behavior. This prevents breakage when frameworks or logging libraries call .toJSON() on the performance object. Change setResourceTimingBufferSize() from throwing 'not implemented' to a silent no-op, matching unenv polyfill behavior. Resource timing is not applicable in Workers, but isomorphic code commonly calls this defensively and should not break. Both changes improve compatibility with the unenv polyfill surface, ensuring that when the enable_global_performance_classes or enable_nodejs_perf_hooks_module flags are active (causing unenv to defer to the native performance object), no functionality is lost compared to what unenv's JS polyfill would have provided.
Files changed
3 files changed~3 modified