Skip to content

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

Merged
Ms2ger merged 1 commit intotc39:mainfrom
caiolima:fix-deferred-ns-super-set
Apr 2, 2026
Merged

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

Conversation

@caiolima
Copy link
Copy Markdown
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
hubot pushed a commit to v8/v8 that referenced this pull request Mar 30, 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 these cases, see:
tc39/test262#4980

[1] - https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor

Change-Id: Ia365a1efb06fa3d3d84fde06bab99bdff2d5e4e8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7688059
Reviewed-by: Olivier Flückiger <olivf@chromium.org>
Commit-Queue: Caio Lima <caiolima@igalia.com>
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#106156}
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows a similar logic as #5000

Copy link
Copy Markdown
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Ms2ger Ms2ger force-pushed the fix-deferred-ns-super-set branch from b3a3741 to 15a105c Compare April 2, 2026 13:15
@Ms2ger Ms2ger enabled auto-merge (rebase) April 2, 2026 13:15
@Ms2ger Ms2ger merged commit b6653be into tc39:main Apr 2, 2026
14 checks passed
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

3 participants