Skip to content

[defer-import-eval] fixing expectation for super property access#4999

Open
caiolima wants to merge 1 commit intotc39:mainfrom
caiolima:fix-deferred-ns-super-set
Open

[defer-import-eval] fixing expectation for super property access#4999
caiolima wants to merge 1 commit intotc39:mainfrom
caiolima:fix-deferred-ns-super-set

Conversation

@caiolima
Copy link
Contributor

This PR actually changes a couple of tests we have using super.prop that are incorrect. They expect that a deferred module won't trigger, however they should trigger evaluation, because the execution path eventually calls [[GetOwnProperty]] on deferred namespaces.

It closes #4980.

@caiolima caiolima requested a review from a team as a code owner March 18, 2026 14:12
caiolima added a commit to caiolima/v8 that referenced this pull request Mar 20, 2026
…ects

Object::SetSuperProperty was short-circuiting to TypeError when the OWN
lookup on the receiver hit MODULE_NAMESPACE, skipping the
[[GetOwnProperty]] call that OrdinarySetWithOwnDescriptor[1] requires per
spec (step 2.c). This meant deferred module evaluation was not triggered
and TDZ bindings incorrectly threw TypeError instead of ReferenceError.

The fix replaces the MODULE_NAMESPACE case with a GetOwnPropertyDescriptor
call that mirrors the existing INTERCEPTOR/JSPROXY path. This properly
invokes the namespace's [[GetOwnProperty]], which:
- Triggers deferred module evaluation for non-symbol-like string keys
- Throws ReferenceError for uninitialized (TDZ) bindings
- Returns a writable descriptor for initialized exports, falling through
  to DefineOwnProperty which rejects the value change (TypeError)

Also marks two test262 tests as FAIL (ignore-super-property-set-exported
and ignore-super-property-set-not-exported) whose expectations are
incorrect per tc39/test262#4999.

For a detailed flow on how spec flows to thse cases, see:
tc39/test262#4980

[1] - https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect ignore-super-property-set(-not)-exported.js tests

1 participant