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
ToPropertyDescriptor fails to evaluate an accessor property named "get" #1627
d8> Object.create([], { x: { get get() { x; } } });
ReferenceError: x is not defined
Actual (QuickJS-ng)
qjs > Object.create([], { x: { get get() { x; } } });
TypeError: Getter must be a function
at create (native)
at <eval> (<evalScript>:1:7)
Spec
Object.create processes the supplied property descriptors using ObjectDefineProperties, which applies ToPropertyDescriptor to the descriptor for "x".
The descriptor object has an accessor property named "get". ToPropertyDescriptor obtains its value using Get(Obj, "get"), which must invoke the accessor getter. Evaluating that getter accesses the unresolvable reference x and throws a ReferenceError.
This abrupt completion must be propagated before the retrieved value can be checked for callability. Therefore, QuickJS-ng should throw the ReferenceError instead of TypeError: Getter must be a function.
Activity
Propagate exceptions from the get/set descriptor accessors