Skip to content

ToPropertyDescriptor fails to evaluate an accessor property named "get" #1627

Closed

Description

@d01c2

Reproduction

Object.create([], { x: { get get() { x; } } });

Expected

A ReferenceError is thrown.

V8 (15.3.27):

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.

Versions

  • QuickJS-ng: 0.16.0
  • V8: 15.3.27

Activity

  1. added a commit that references this issue on Aug 20, 2026
    6385234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions