You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[parity] node:perf_hooks — the perf classes have no real prototype: no illegal-constructor guard, Symbol.toStringTag, or descriptors #8231
Split out of #6766 after PR #8229 took node:perf_hooks from 86/148 to 132/148. These six cases all need the same missing machinery — real prototype objects for the native perf classes, carrying brand checks and per-property descriptors — so they are one piece of work rather than six.
Perry models the perf classes as bound-method closures and their instances as plain shaped objects. That gets instanceof right (via the class-id chain) but leaves no prototype object to hang Symbol.toStringTag, descriptors, or a construct trap on.
Failing cases
test-parity/node-suite/perf_hooks/, reproduce with ./run_parity_tests.sh --suite node-suite --module perf_hooks.
global/illegal-constructors — the classes are not constructible in Node:
node: Performance: TypeError ERR_ILLEGAL_CONSTRUCTOR (same for PerformanceEntry,
PerformanceMeasure, PerformanceObserverEntryList, PerformanceResourceTiming)
perry: Performance: no throw
shapes/prototype-tags — Symbol.toStringTag on each prototype:
node: mark [object PerformanceMark] / measure [object PerformanceMeasure] / observer [object PerformanceObserver]
PerformanceMark PerformanceMark (and the same for Measure/Observer/ObserverEntryList/ResourceTiming)
perry: mark [object Object] / measure [object Object] / observer [object Object]
(the Ctor.prototype descriptor reads produce nothing)
crates/perry-runtime/src/perf_hooks.rs (entry shapes, is_perf_entry_object_instance_of), crates/perry-runtime/src/object/native_module/callable_exports.rs (nm_attach_perf_hooks, which is where PerformanceObserver.supportedEntryTypes is already hung off the class closure as a dynamic prop — the same hook could carry a prototype).
Activity