Skip to content
Commit Detail

Commit c9767be

Author
Harris Hancock <harris@cloudflare.com> 2026-04-09 12:52:45 +0100
Parents
32a5758
Tree
0812408
Add regression test for Object.getOwnPropertyDescriptors with JSG_INSPECT_PROPERTY

Regression test for https://github.com/cloudflare/workerd/issues/4147.

Object.getOwnPropertyDescriptors() on a JSG prototype with
JSG_INSPECT_PROPERTY used to throw "Illegal invocation" because
registerInspectProperty() used SetNativeDataProperty on the prototype.
V8 would invoke the native getter callback during descriptor retrieval
to produce a data descriptor value, and the callback's HasInstance check
would fail because the prototype object is not an instance of the type.

Fixed by PR #6003 (c43c98ac8), which changed registerInspectProperty()
to use SetAccessorProperty instead.

Assisted-by: Claude

Files changed

1 file changed~1 modified