Skip to content

Proxy defineProperty trap skips the required target extensibility check #1626

Closed

Description

@d01c2

Reproduction

Reflect.defineProperty(
  new Proxy(
    new Proxy({}, { isExtensible: 0 }),
    { defineProperty() { return true; } }
  ),
  "x",
  {}
);

Expected

A TypeError is thrown.

V8 (15.3.27):

d8> Reflect.defineProperty(new Proxy(new Proxy({}, { isExtensible: 0 }), { defineProperty() { return true; } }), "x", {});
TypeError: '0' returned for property 'isExtensible' of object '#<Object>' is not a function

Actual (QuickJS-ng)

QuickJS-ng returns true without checking the target's isExtensible trap:

qjs > Reflect.defineProperty(new Proxy(new Proxy({}, { isExtensible: 0 }), { defineProperty() { return true; } }), "x", {});
true

Spec

After the defineProperty trap returns a truthy value, the Proxy [[DefineOwnProperty]] method obtains the target's property descriptor and calls IsExtensible(target).

Here, the target is the inner Proxy. Its [[IsExtensible]] method obtains the handler's isExtensible method. Since its value is 0, which is not callable, this operation must throw a TypeError.

Therefore, Reflect.defineProperty must propagate the TypeError instead of returning true.

Versions

  • QuickJS-ng: 0.16.0
  • V8: 15.3.27

Activity

  1. saghul commented on Aug 2, 2026

    @saghul
    Contributor

    Thanks for the report!

  2. added a commit that references this issue on Aug 20, 2026
    32b6912
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