[defer-import-eval] deferred import evaluation for ES modules [v8/v8 : main]

0 views
Skip to first unread message

Caio Lima (Gerrit)

unread,
Dec 15, 2025, 12:38:27 PM12/15/25
to Igor Sheludko, V8 LUCI CQ, Olivier Flückiger, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko, Leszek Swirski and Olivier Flückiger

Caio Lima added 3 comments

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Caio Lima . resolved

This new CL includes all the operations that should trigger an module evaluation.

File src/objects/js-objects.cc
Line 104, Patchset 4: case LookupIterator::DEFERRED_MODULE_NAMESPACE:
Igor Sheludko . resolved

This should be reachable via `Object.hasOwn()`. Please write a test for this.

It should evaluate the module and `continue`.

Caio Lima

I was planning to do other operations [[Has]], [[Set]], [[Delete]], [[GetOwnProperty]], etc in a separate patch to make it easier we review each case, but I can do them here if you prefer.

Igor Sheludko

Let's try to put it into one CL as long as it's not huge.

Caio Lima

Acknowledged

File src/objects/objects.cc
Line 1287, Patchset 4: it->GetName());
Igor Sheludko . resolved

Can we make it so that here we do just `JSDeferredModuleNamespace::EvaluateModuleSync(isolate, holder);` + exception handling, and let the regular path for `JSModuleNamespace` objects handle the rest?

Caio Lima

Yes. This would mean basically to inline `JSDeferredModuleNamespace::GetProperty` here. In this new Patchset, once a module is evaluated, it will never get through `DEFERRED_MODULE_NAMESPACE` anymore, as you suggested above.

Caio Lima

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 6
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Dec 2025 17:38:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Caio Lima <caio...@igalia.com>
Comment-In-Reply-To: Igor Sheludko <ish...@chromium.org>
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 16, 2025, 9:25:15 AM12/16/25
to Igor Sheludko, V8 LUCI CQ, Olivier Flückiger, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko, Leszek Swirski and Olivier Flückiger

Caio Lima added 1 comment

File src/runtime/runtime-forin.cc
Line 78, Patchset 4: case LookupIterator::DEFERRED_MODULE_NAMESPACE:
Igor Sheludko . unresolved

This case might be reachable via `ns.propertyIsEnumerable(..)`.

Caio Lima

Thanks for pointing this out. I'm adding a test case for it as well. I don't know why I missed this comment before.

When using `Object.prototype.propertyIsEnumerable`, it actually goes to `JSReceiver::GetOwnPropertyAttributes` (ref: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/builtins-object.cc;l=31;drc=d26244cc105a77ea0708ee85fd8cf2e3ab33c608), that is analogous to `[[GetOwnProperty]]` from spec (ref: https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable).

Also, it's important to notice that `ns.propertyIsEnumerable` will trigger evaluation due to `[[Get]]` first, so at this point, this `DEFERRED_MODULE_NAMESPACE` state should be unexpected as well. Another thing that's important is that namespace's prototype is null, and since it's also non-extensible, it can't be changed. The way to execute `propertyIsEnumrable` is through `Object.prototype.propertyIsEnumerable(ns, ...)`.

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 8
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Dec 2025 14:25:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Igor Sheludko <ish...@chromium.org>
unsatisfied_requirement
open
diffy

Olivier Flückiger (Gerrit)

unread,
Dec 16, 2025, 10:21:58 AM12/16/25
to Caio Lima, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima, Igor Sheludko and Leszek Swirski

Olivier Flückiger added 5 comments

Patchset-level comments
File-level comment, Patchset 10 (Latest):
Olivier Flückiger . resolved

I am basically happy. Only one question left on my last pass over the CL.

File src/ic/ic.cc
Line 1020, Patchset 2: LoadHandler::LoadModuleExport(isolate(), value_index);
Olivier Flückiger . resolved

I would like to see a CSA_DCHECK that this load never happens on an unevaluated object.

This would go here: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/ic/accessor-assembler.cc;l=1000;drc=adf1c0b0a7acf756e039e4203f41018e4bae22d0;bpv=0;bpt=1

Caio Lima

Here I'd need something that asserts `IsJSDeferredModuleNamespace(receiver) && module->status() == kEvaluated`. Would it make sense? The thing is that we can have accesses to ordinary module namespaces while it's module is not evaluated yet, since they can be in a evaluating or evaluating-async` state if there's a dependency cycle.

Caio Lima

This code doesn't exist in the new version, but I'm wondering if we'd still want to add this CSA_DCHECK there as well.

Igor Sheludko

IIUC the spec correctly that evaluated module does not require any more processing. I'd suggest to treat `LookupIterator::DEFERRED_MODULE_NAMESPACE` state as "not yet evaluated deferred module", and thus once it's evaluated we wouldn't even get into this case again.

Caio Lima

I think that's the behavior we have now, right? In the implementation of `JSDeferredModuleNamespace::TriggersEvaluation`, we do check if the module is evaluated or not. The only detail here is that if a module gets evaluated and transitions to `kErrored` estate because it throws, we still keep going through `LookupIterator::DEFERRED_MODULE_NAMESPACE`, because every future access to the `ns` needs to throws the same Exception, and it's stored in the module's `top_level_capability`. That's also the reason why we don't cache access in this case.

Olivier Flückiger

Acknowledged

File src/objects/js-objects.cc
Line 181, Patchset 8: case LookupIterator::DEFERRED_MODULE_NAMESPACE:
Olivier Flückiger . unresolved

When do we end up here?

Line 1042, Patchset 8: // TODO(https://crbug.com/348660658): replace language mode
Olivier Flückiger . unresolved
```suggestion
// TODO(348660658): replace language mode
```
File src/objects/module.cc
Line 511, Patchset 2: return true;
Olivier Flückiger . resolved

should we return false if it is already evaluated? (unsure about the implications)

Caio Lima

The implication here is that once a module gets evaluated, we will never get `DEFERRED_MODULE_NAMESPACE` kind.

This would require that I install the accessors for exported names once, and behave like `JSModuleNamespace` now. I didn't think about that earlier, but this could be work. For now I'm mostly doing on `MaybeEvaluate`, however doing this here can simplify things a bit. This might better, since I don't have to think in how IC would work with `DEFERRED_MODULE_NAMESPACE, and it will behave pretty much like `JSModuleNamespace` does today. I'll give it a try.

Caio Lima

I changed it in this new Patchset. I feel this version is better than before, since we won't have much difference between an evaluated deferred module and an ordinary module anymore. Also the IC handling is pretty much like `do nothing if the module is not evaluated`. Once it's evaluated, it'll get the same IC behavior as ordinary module namespaces.

Olivier Flückiger

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Caio Lima
  • Igor Sheludko
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 10
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Caio Lima <caio...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Dec 2025 15:21:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Caio Lima <caio...@igalia.com>
Comment-In-Reply-To: Igor Sheludko <ish...@chromium.org>
Comment-In-Reply-To: Olivier Flückiger <ol...@chromium.org>
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 16, 2025, 12:15:50 PM12/16/25
to Igor Sheludko, V8 LUCI CQ, Olivier Flückiger, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko, Leszek Swirski and Olivier Flückiger

Caio Lima added 1 comment

File src/objects/js-objects.cc
Line 181, Patchset 8: case LookupIterator::DEFERRED_MODULE_NAMESPACE:
Olivier Flückiger . unresolved

When do we end up here?

Caio Lima

One path that I see is coming from Object::NoSideEffectsToString. This is called with `"toString"` when formatting an error message, (https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/objects.cc;l=636;drc=07576e5c96c664c421fcf6fb0dfdb940622f8aa3). This is a test case where this gets called (https://github.com/tc39/test262/blob/079b13f85da120049919365612163e4579678e89/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-delete.js). Looks like all the callers for it are somewhat internal operations, and we shouldn't trigger an evaluation here, otherwise, it'll break the spec.

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 10
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Dec 2025 17:15:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Olivier Flückiger <ol...@chromium.org>
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 16, 2025, 12:19:17 PM12/16/25
to Igor Sheludko, V8 LUCI CQ, Olivier Flückiger, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko, Leszek Swirski and Olivier Flückiger

Caio Lima added 1 comment

File src/objects/js-objects.cc
Line 1042, Patchset 8: // TODO(https://crbug.com/348660658): replace language mode
Olivier Flückiger . resolved
```suggestion
// TODO(348660658): replace language mode
```
Caio Lima

Fix applied.

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 11
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Tue, 16 Dec 2025 17:19:12 +0000
unsatisfied_requirement
open
diffy

Olivier Flückiger (Gerrit)

unread,
Dec 17, 2025, 10:10:26 AM12/17/25
to Caio Lima, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima, Igor Sheludko and Leszek Swirski

Olivier Flückiger voted and added 2 comments

Votes added by Olivier Flückiger

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Olivier Flückiger . resolved

lgtm, thanks a lot and nice work!

@ish...@chromium.org could you do another pass please?

File src/objects/js-objects.cc
Line 181, Patchset 8: case LookupIterator::DEFERRED_MODULE_NAMESPACE:
Olivier Flückiger . resolved

When do we end up here?

Caio Lima

One path that I see is coming from Object::NoSideEffectsToString. This is called with `"toString"` when formatting an error message, (https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/objects.cc;l=636;drc=07576e5c96c664c421fcf6fb0dfdb940622f8aa3). This is a test case where this gets called (https://github.com/tc39/test262/blob/079b13f85da120049919365612163e4579678e89/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-delete.js). Looks like all the callers for it are somewhat internal operations, and we shouldn't trigger an evaluation here, otherwise, it'll break the spec.

Olivier Flückiger

ok, yeah, the callers look fine.

Open in Gerrit

Related details

Attention is currently required from:
  • Caio Lima
  • Igor Sheludko
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 11
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Caio Lima <caio...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Dec 2025 15:10:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Caio Lima <caio...@igalia.com>
Comment-In-Reply-To: Olivier Flückiger <ol...@chromium.org>
unsatisfied_requirement
open
diffy

Olivier Flückiger (Gerrit)

unread,
Dec 17, 2025, 10:56:11 AM12/17/25
to Caio Lima, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima, Igor Sheludko and Leszek Swirski

Olivier Flückiger added 1 comment

Commit Message
Line 19, Patchset 11 (Latest):- Implement property operation triggers for [[Get]].
Olivier Flückiger . unresolved

This is out of date now.

Gerrit-Comment-Date: Wed, 17 Dec 2025 15:56:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 17, 2025, 12:43:58 PM12/17/25
to Olivier Flückiger, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko and Leszek Swirski

Caio Lima added 1 comment

Commit Message
Line 19, Patchset 11:- Implement property operation triggers for [[Get]].
Olivier Flückiger . resolved

This is out of date now.

Caio Lima

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 13
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Dec 2025 17:43:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Olivier Flückiger <ol...@chromium.org>
unsatisfied_requirement
open
diffy

Igor Sheludko (Gerrit)

unread,
Dec 18, 2025, 11:20:10 AM12/18/25
to Caio Lima, Olivier Flückiger, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima and Leszek Swirski

Igor Sheludko added 7 comments

Patchset-level comments
File-level comment, Patchset 14 (Latest):
Igor Sheludko . resolved

looks good, some nits and comments about [[Set]] and `!IsSymbolLikeNamespaceKey(P, O)` case.

File src/builtins/builtins-object.cc
Line 168, Patchset 14 (Latest): if (isolate->has_exception()) {
return isolate->exception();
}
Igor Sheludko . unresolved

Magic macro for such cases: `RETURN_FAILURE_IF_EXCEPTION(isolate);`

File src/objects/keys.cc
Line 1059, Patchset 14 (Latest): }
Igor Sheludko . unresolved

Nit: I think the caller function `KeyAccumulator::CollectOwnKeys(..)` is a better place for handling this case. Right after `if (IsAccessCheckNeeded(*object) &&`.

File src/objects/module.cc
File src/objects/objects.cc
Line 2455, Patchset 14 (Latest): if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . unresolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Line 2463, Patchset 14 (Latest): return Nothing<bool>();
Igor Sheludko . unresolved

We should return `Just(false);`, `Nothing` is an indication that exception was thrown.

File src/runtime/runtime-forin.cc
Line 78, Patchset 4: case LookupIterator::DEFERRED_MODULE_NAMESPACE:
Igor Sheludko . unresolved

This case might be reachable via `ns.propertyIsEnumerable(..)`.

Caio Lima

Thanks for pointing this out. I'm adding a test case for it as well. I don't know why I missed this comment before.

When using `Object.prototype.propertyIsEnumerable`, it actually goes to `JSReceiver::GetOwnPropertyAttributes` (ref: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/builtins-object.cc;l=31;drc=d26244cc105a77ea0708ee85fd8cf2e3ab33c608), that is analogous to `[[GetOwnProperty]]` from spec (ref: https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable).

Also, it's important to notice that `ns.propertyIsEnumerable` will trigger evaluation due to `[[Get]]` first, so at this point, this `DEFERRED_MODULE_NAMESPACE` state should be unexpected as well. Another thing that's important is that namespace's prototype is null, and since it's also non-extensible, it can't be changed. The way to execute `propertyIsEnumrable` is through `Object.prototype.propertyIsEnumerable(ns, ...)`.

Igor Sheludko

Ack!
Nit: please put this comment inside `case LookupIterator::DEFERRED_MODULE_NAMESPACE:`.

Open in Gerrit

Related details

Attention is currently required from:
  • Caio Lima
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 14
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Caio Lima <caio...@igalia.com>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 16:20:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 18, 2025, 2:12:01 PM12/18/25
to Olivier Flückiger, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko and Leszek Swirski

Caio Lima added 1 comment

File src/objects/objects.cc
Line 2455, Patchset 14 (Latest): if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . unresolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Caio Lima

Oh right, I misunderstood the spec at this part. I just figured out now that the logic to install a new property is here (https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor), and it actually happens inside prototype.[[Set]].

BTW, IIUC, we should not be doing IsSymbolLikeNamespaceKey(P, O) step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for !IsSymbolLikeNamespaceKey(P, O) case and deferred module somewhere.

Thinking this a little deeper, I think we might have a bug for all module namespaces, both deferred and ordinary. The way we implement module namespace right now allows to a program like the one bellow to execute without errors, but it actually should throw when running on strict mode:

```
import * as ns from './foo_module.mjs'

let obj = Object.create(ns);

obj.missingProp = 10;
obj.missingProp; // returns 10, but this set should never happen.
```

The design I was thinking here was that any access that would trigger an evaluation, we actually throw an error. Otherwise fallback to ordinary ModuleNamespace logic - which shares the same [[Set]] we have for Deferred Modules (https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-set-p-v-receiver). I did that because I couldn't find a way to know if a Lookup is happening to a [[Set]] operation. However, since ordinary namespaces looks broken as well, it doesn't work.

Would it be too problematic if I add a configuration in LookupIterator to be able to know if it's a lookup for a [[Set]]?

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 14
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 19:11:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Igor Sheludko <ish...@chromium.org>
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 18, 2025, 2:17:12 PM12/18/25
to Olivier Flückiger, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko and Leszek Swirski

Caio Lima added 1 comment

File src/objects/objects.cc
Line 2455, Patchset 14 (Latest): if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . unresolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Caio Lima

Oh right, I misunderstood the spec at this part. I just figured out now that the logic to install a new property is here (https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor), and it actually happens inside prototype.[[Set]].

BTW, IIUC, we should not be doing IsSymbolLikeNamespaceKey(P, O) step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for !IsSymbolLikeNamespaceKey(P, O) case and deferred module somewhere.

Thinking this a little deeper, I think we might have a bug for all module namespaces, both deferred and ordinary. The way we implement module namespace right now allows to a program like the one bellow to execute without errors, but it actually should throw when running on strict mode:

```
import * as ns from './foo_module.mjs'

let obj = Object.create(ns);

obj.missingProp = 10;
obj.missingProp; // returns 10, but this set should never happen.
```

The design I was thinking here was that any access that would trigger an evaluation, we actually throw an error. Otherwise fallback to ordinary ModuleNamespace logic - which shares the same [[Set]] we have for Deferred Modules (https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-set-p-v-receiver). I did that because I couldn't find a way to know if a Lookup is happening to a [[Set]] operation. However, since ordinary namespaces looks broken as well, it doesn't work.

Would it be too problematic if I add a configuration in LookupIterator to be able to know if it's a lookup for a [[Set]]?

Caio Lima

Doing such a way in lookup iterator, we would be able to probably fix the issue we have for ordinary Namespaces.

An alternative I can think could be to add a check in `NOT_FOUND` and check if the last check "holder" is a `JSModuleNamespace`, and if this is the case, we throw an error if we are in strict mode. The thing there is that we can't ever have a `JSModuleNamespace` in the middle of a prototype chain, since its prototype is null and it's non extensible. So it needs to be the last object of the chain.

Gerrit-Comment-Date: Thu, 18 Dec 2025 19:17:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Igor Sheludko (Gerrit)

unread,
Dec 18, 2025, 3:03:39 PM12/18/25
to Caio Lima, Olivier Flückiger, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima and Leszek Swirski

Igor Sheludko added 1 comment

File src/objects/objects.cc
Line 2455, Patchset 14 (Latest): if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . unresolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Caio Lima

Oh right, I misunderstood the spec at this part. I just figured out now that the logic to install a new property is here (https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor), and it actually happens inside prototype.[[Set]].

BTW, IIUC, we should not be doing IsSymbolLikeNamespaceKey(P, O) step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for !IsSymbolLikeNamespaceKey(P, O) case and deferred module somewhere.

Thinking this a little deeper, I think we might have a bug for all module namespaces, both deferred and ordinary. The way we implement module namespace right now allows to a program like the one bellow to execute without errors, but it actually should throw when running on strict mode:

```
import * as ns from './foo_module.mjs'

let obj = Object.create(ns);

obj.missingProp = 10;
obj.missingProp; // returns 10, but this set should never happen.
```

The design I was thinking here was that any access that would trigger an evaluation, we actually throw an error. Otherwise fallback to ordinary ModuleNamespace logic - which shares the same [[Set]] we have for Deferred Modules (https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-set-p-v-receiver). I did that because I couldn't find a way to know if a Lookup is happening to a [[Set]] operation. However, since ordinary namespaces looks broken as well, it doesn't work.

Would it be too problematic if I add a configuration in LookupIterator to be able to know if it's a lookup for a [[Set]]?

Caio Lima

Doing such a way in lookup iterator, we would be able to probably fix the issue we have for ordinary Namespaces.

An alternative I can think could be to add a check in `NOT_FOUND` and check if the last check "holder" is a `JSModuleNamespace`, and if this is the case, we throw an error if we are in strict mode. The thing there is that we can't ever have a `JSModuleNamespace` in the middle of a prototype chain, since its prototype is null and it's non extensible. So it needs to be the last object of the chain.

Igor Sheludko

I think what would help is to have just one new `MODULE_NAMESPACE` state which would be set for both normal and deferred module namespace object. And the reaction to it would be to trigger evaluation of the deferred module if a particular operation requires it and/or continue lookup.

Open in Gerrit

Related details

Attention is currently required from:
  • Caio Lima
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 14
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Caio Lima <caio...@igalia.com>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 20:03:33 +0000
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 18, 2025, 3:47:50 PM12/18/25
to Olivier Flückiger, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko and Leszek Swirski

Caio Lima added 1 comment

File src/objects/objects.cc
Line 2455, Patchset 14 (Latest): if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . unresolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Caio Lima

Oh right, I misunderstood the spec at this part. I just figured out now that the logic to install a new property is here (https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor), and it actually happens inside prototype.[[Set]].

BTW, IIUC, we should not be doing IsSymbolLikeNamespaceKey(P, O) step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for !IsSymbolLikeNamespaceKey(P, O) case and deferred module somewhere.

Thinking this a little deeper, I think we might have a bug for all module namespaces, both deferred and ordinary. The way we implement module namespace right now allows to a program like the one bellow to execute without errors, but it actually should throw when running on strict mode:

```
import * as ns from './foo_module.mjs'

let obj = Object.create(ns);

obj.missingProp = 10;
obj.missingProp; // returns 10, but this set should never happen.
```

The design I was thinking here was that any access that would trigger an evaluation, we actually throw an error. Otherwise fallback to ordinary ModuleNamespace logic - which shares the same [[Set]] we have for Deferred Modules (https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-set-p-v-receiver). I did that because I couldn't find a way to know if a Lookup is happening to a [[Set]] operation. However, since ordinary namespaces looks broken as well, it doesn't work.

Would it be too problematic if I add a configuration in LookupIterator to be able to know if it's a lookup for a [[Set]]?

Caio Lima

Doing such a way in lookup iterator, we would be able to probably fix the issue we have for ordinary Namespaces.

An alternative I can think could be to add a check in `NOT_FOUND` and check if the last check "holder" is a `JSModuleNamespace`, and if this is the case, we throw an error if we are in strict mode. The thing there is that we can't ever have a `JSModuleNamespace` in the middle of a prototype chain, since its prototype is null and it's non extensible. So it needs to be the last object of the chain.

Igor Sheludko

I think what would help is to have just one new `MODULE_NAMESPACE` state which would be set for both normal and deferred module namespace object. And the reaction to it would be to trigger evaluation of the deferred module if a particular operation requires it and/or continue lookup.

Caio Lima

Is it fine if after a state `MODULE_NAMESPACE` happens and we call `LookupIterator::Next()` it will fallback to perform a `LookupInRegularHolder`? If so, I can try to do that. This would mean that I'll end up calling `continue` on pretty much all places when holder is not a JSDeferredModuleNamespace, but this can solve this issue.

I've implemented the version that checks on `NOT_FOUND` state of `SetPropertyInternal`, but thinking this through, I think it's not acceptable, since it'll slow down every `obj.prop = ...` operation that takes the slow path.

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 14
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Dec 2025 20:47:46 +0000
unsatisfied_requirement
open
diffy

Igor Sheludko (Gerrit)

unread,
Dec 19, 2025, 6:41:45 AM12/19/25
to Caio Lima, Olivier Flückiger, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima and Leszek Swirski

Igor Sheludko added 1 comment

File src/objects/objects.cc
Line 2455, Patchset 14 (Latest): if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . unresolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Caio Lima

Oh right, I misunderstood the spec at this part. I just figured out now that the logic to install a new property is here (https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor), and it actually happens inside prototype.[[Set]].

BTW, IIUC, we should not be doing IsSymbolLikeNamespaceKey(P, O) step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for !IsSymbolLikeNamespaceKey(P, O) case and deferred module somewhere.

Thinking this a little deeper, I think we might have a bug for all module namespaces, both deferred and ordinary. The way we implement module namespace right now allows to a program like the one bellow to execute without errors, but it actually should throw when running on strict mode:

```
import * as ns from './foo_module.mjs'

let obj = Object.create(ns);

obj.missingProp = 10;
obj.missingProp; // returns 10, but this set should never happen.
```

The design I was thinking here was that any access that would trigger an evaluation, we actually throw an error. Otherwise fallback to ordinary ModuleNamespace logic - which shares the same [[Set]] we have for Deferred Modules (https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-set-p-v-receiver). I did that because I couldn't find a way to know if a Lookup is happening to a [[Set]] operation. However, since ordinary namespaces looks broken as well, it doesn't work.

Would it be too problematic if I add a configuration in LookupIterator to be able to know if it's a lookup for a [[Set]]?

Caio Lima

Doing such a way in lookup iterator, we would be able to probably fix the issue we have for ordinary Namespaces.

An alternative I can think could be to add a check in `NOT_FOUND` and check if the last check "holder" is a `JSModuleNamespace`, and if this is the case, we throw an error if we are in strict mode. The thing there is that we can't ever have a `JSModuleNamespace` in the middle of a prototype chain, since its prototype is null and it's non extensible. So it needs to be the last object of the chain.

Igor Sheludko

I think what would help is to have just one new `MODULE_NAMESPACE` state which would be set for both normal and deferred module namespace object. And the reaction to it would be to trigger evaluation of the deferred module if a particular operation requires it and/or continue lookup.

Caio Lima

Is it fine if after a state `MODULE_NAMESPACE` happens and we call `LookupIterator::Next()` it will fallback to perform a `LookupInRegularHolder`? If so, I can try to do that. This would mean that I'll end up calling `continue` on pretty much all places when holder is not a JSDeferredModuleNamespace, but this can solve this issue.

I've implemented the version that checks on `NOT_FOUND` state of `SetPropertyInternal`, but thinking this through, I think it's not acceptable, since it'll slow down every `obj.prop = ...` operation that takes the slow path.

Igor Sheludko

Yes, it's totally fine, given that JSModuleNamespaces require such an orthogonal behavior.

Open in Gerrit

Related details

Attention is currently required from:
  • Caio Lima
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 14
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Caio Lima <caio...@igalia.com>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 11:41:40 +0000
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 19, 2025, 10:15:47 AM12/19/25
to Olivier Flückiger, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko, Leszek Swirski and Olivier Flückiger

Caio Lima added 5 comments

File src/builtins/builtins-object.cc
Line 168, Patchset 14: if (isolate->has_exception()) {
return isolate->exception();
}
Igor Sheludko . resolved

Magic macro for such cases: `RETURN_FAILURE_IF_EXCEPTION(isolate);`

Caio Lima

Done

File src/objects/keys.cc
Line 1059, Patchset 14: }
Igor Sheludko . resolved

Nit: I think the caller function `KeyAccumulator::CollectOwnKeys(..)` is a better place for handling this case. Right after `if (IsAccessCheckNeeded(*object) &&`.

Caio Lima

Done

File src/objects/module.cc
File src/objects/objects.cc
Line 2463, Patchset 14: return Nothing<bool>();
Igor Sheludko . resolved

We should return `Just(false);`, `Nothing` is an indication that exception was thrown.

Caio Lima

Acknowledged

File src/runtime/runtime-forin.cc
Line 78, Patchset 4: case LookupIterator::DEFERRED_MODULE_NAMESPACE:
Igor Sheludko . resolved

This case might be reachable via `ns.propertyIsEnumerable(..)`.

Caio Lima

Thanks for pointing this out. I'm adding a test case for it as well. I don't know why I missed this comment before.

When using `Object.prototype.propertyIsEnumerable`, it actually goes to `JSReceiver::GetOwnPropertyAttributes` (ref: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/builtins-object.cc;l=31;drc=d26244cc105a77ea0708ee85fd8cf2e3ab33c608), that is analogous to `[[GetOwnProperty]]` from spec (ref: https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable).

Also, it's important to notice that `ns.propertyIsEnumerable` will trigger evaluation due to `[[Get]]` first, so at this point, this `DEFERRED_MODULE_NAMESPACE` state should be unexpected as well. Another thing that's important is that namespace's prototype is null, and since it's also non-extensible, it can't be changed. The way to execute `propertyIsEnumrable` is through `Object.prototype.propertyIsEnumerable(ns, ...)`.

Igor Sheludko

Ack!
Nit: please put this comment inside `case LookupIterator::DEFERRED_MODULE_NAMESPACE:`.

Caio Lima

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 15
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 15:15:42 +0000
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Dec 19, 2025, 10:23:01 AM12/19/25
to Olivier Flückiger, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko, Leszek Swirski and Olivier Flückiger

Caio Lima added 1 comment

File src/objects/objects.cc
Line 2455, Patchset 14: if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . unresolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Caio Lima

Oh right, I misunderstood the spec at this part. I just figured out now that the logic to install a new property is here (https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor), and it actually happens inside prototype.[[Set]].

BTW, IIUC, we should not be doing IsSymbolLikeNamespaceKey(P, O) step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for !IsSymbolLikeNamespaceKey(P, O) case and deferred module somewhere.

Thinking this a little deeper, I think we might have a bug for all module namespaces, both deferred and ordinary. The way we implement module namespace right now allows to a program like the one bellow to execute without errors, but it actually should throw when running on strict mode:

```
import * as ns from './foo_module.mjs'

let obj = Object.create(ns);

obj.missingProp = 10;
obj.missingProp; // returns 10, but this set should never happen.
```

The design I was thinking here was that any access that would trigger an evaluation, we actually throw an error. Otherwise fallback to ordinary ModuleNamespace logic - which shares the same [[Set]] we have for Deferred Modules (https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-set-p-v-receiver). I did that because I couldn't find a way to know if a Lookup is happening to a [[Set]] operation. However, since ordinary namespaces looks broken as well, it doesn't work.

Would it be too problematic if I add a configuration in LookupIterator to be able to know if it's a lookup for a [[Set]]?

Caio Lima

Doing such a way in lookup iterator, we would be able to probably fix the issue we have for ordinary Namespaces.

An alternative I can think could be to add a check in `NOT_FOUND` and check if the last check "holder" is a `JSModuleNamespace`, and if this is the case, we throw an error if we are in strict mode. The thing there is that we can't ever have a `JSModuleNamespace` in the middle of a prototype chain, since its prototype is null and it's non extensible. So it needs to be the last object of the chain.

Igor Sheludko

I think what would help is to have just one new `MODULE_NAMESPACE` state which would be set for both normal and deferred module namespace object. And the reaction to it would be to trigger evaluation of the deferred module if a particular operation requires it and/or continue lookup.

Caio Lima

Is it fine if after a state `MODULE_NAMESPACE` happens and we call `LookupIterator::Next()` it will fallback to perform a `LookupInRegularHolder`? If so, I can try to do that. This would mean that I'll end up calling `continue` on pretty much all places when holder is not a JSDeferredModuleNamespace, but this can solve this issue.

I've implemented the version that checks on `NOT_FOUND` state of `SetPropertyInternal`, but thinking this through, I think it's not acceptable, since it'll slow down every `obj.prop = ...` operation that takes the slow path.

Igor Sheludko

Yes, it's totally fine, given that JSModuleNamespaces require such an orthogonal behavior.

Caio Lima

I changed it to use `MODULE_NAMESPACE` now. The design idea here is that when in this state, it triggers evaluation for deferred module, and then continue the lookup to properly perform the operation. This looks better than before, because deferred and ordinary module namespaces share the same execution path, with just a difference of evaluation trigger when it's required.

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 17
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 15:22:58 +0000
unsatisfied_requirement
open
diffy

Igor Sheludko (Gerrit)

unread,
Dec 19, 2025, 11:19:12 AM12/19/25
to Caio Lima, Olivier Flückiger, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima, Leszek Swirski and Olivier Flückiger

Igor Sheludko added 10 comments

Patchset-level comments
File-level comment, Patchset 17:
Igor Sheludko . resolved

very nice! just some nits

File src/ic/ic.cc
Line 903, Patchset 17: DCHECK(ns->module()->status() != Module::kEvaluated);
Igor Sheludko . unresolved

`DCHECK_EQ`

File src/objects/js-objects.cc
Line 182, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . unresolved

I think the right thing would be to set state to NotFound and return undefined (as in JSPROXY case) for deferred module requiring evaluation.

Line 782, Patchset 17: JSDeferredModuleNamespace::EvaluateModuleSync(it->isolate(), holder);
Igor Sheludko . unresolved

We need to handle exceptions:
```
RETURN_EXCEPTION_IF_EXCEPTION(it->isolate());
```

Line 1005, Patchset 17: // TODO(348660658): replace language mode
Igor Sheludko . unresolved

Please revert these changes, having a link eases opening the bug tracker.

Line 3759, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . unresolved

Please double-check this case. I think we can get here via `[[DefineOwnProperty]]` (EnforceDefineSemantics::kDefine).

File src/objects/keys.cc
Line 1212, Patchset 17: RETURN_VALUE_IF_EXCEPTION(isolate_, Nothing<bool>());
Igor Sheludko . unresolved

Nit: `RETURN_EXCEPTION_IF_EXCEPTION(isolate_);` would be nicer.

File src/objects/objects.cc
Line 2455, Patchset 14: if (it->HolderIsReceiverOrHiddenPrototype()) {
Igor Sheludko . resolved

This doesn't seem to be correct. As Nicolò Ribaudo pointed out in another CL, once we reached `[[Set]]` for deferred module, regardless of whether it happened for a direct store to a module of through a prototype chain of another object - we are done. So we shouldn't do this check.

BTW, IIUC, we should not be doing `IsSymbolLikeNamespaceKey(P, O)` step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for `!IsSymbolLikeNamespaceKey(P, O)` case and deferred module somewhere.

Caio Lima

Oh right, I misunderstood the spec at this part. I just figured out now that the logic to install a new property is here (https://tc39.es/ecma262/#sec-ordinarysetwithowndescriptor), and it actually happens inside prototype.[[Set]].

BTW, IIUC, we should not be doing IsSymbolLikeNamespaceKey(P, O) step for [[Set]] operation, it disallows ANY property store. I guess there should be a similar counter part for !IsSymbolLikeNamespaceKey(P, O) case and deferred module somewhere.

Thinking this a little deeper, I think we might have a bug for all module namespaces, both deferred and ordinary. The way we implement module namespace right now allows to a program like the one bellow to execute without errors, but it actually should throw when running on strict mode:

```
import * as ns from './foo_module.mjs'

let obj = Object.create(ns);

obj.missingProp = 10;
obj.missingProp; // returns 10, but this set should never happen.
```

The design I was thinking here was that any access that would trigger an evaluation, we actually throw an error. Otherwise fallback to ordinary ModuleNamespace logic - which shares the same [[Set]] we have for Deferred Modules (https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-set-p-v-receiver). I did that because I couldn't find a way to know if a Lookup is happening to a [[Set]] operation. However, since ordinary namespaces looks broken as well, it doesn't work.

Would it be too problematic if I add a configuration in LookupIterator to be able to know if it's a lookup for a [[Set]]?

Caio Lima

Doing such a way in lookup iterator, we would be able to probably fix the issue we have for ordinary Namespaces.

An alternative I can think could be to add a check in `NOT_FOUND` and check if the last check "holder" is a `JSModuleNamespace`, and if this is the case, we throw an error if we are in strict mode. The thing there is that we can't ever have a `JSModuleNamespace` in the middle of a prototype chain, since its prototype is null and it's non extensible. So it needs to be the last object of the chain.

Igor Sheludko

I think what would help is to have just one new `MODULE_NAMESPACE` state which would be set for both normal and deferred module namespace object. And the reaction to it would be to trigger evaluation of the deferred module if a particular operation requires it and/or continue lookup.

Caio Lima

Is it fine if after a state `MODULE_NAMESPACE` happens and we call `LookupIterator::Next()` it will fallback to perform a `LookupInRegularHolder`? If so, I can try to do that. This would mean that I'll end up calling `continue` on pretty much all places when holder is not a JSDeferredModuleNamespace, but this can solve this issue.

I've implemented the version that checks on `NOT_FOUND` state of `SetPropertyInternal`, but thinking this through, I think it's not acceptable, since it'll slow down every `obj.prop = ...` operation that takes the slow path.

Igor Sheludko

Yes, it's totally fine, given that JSModuleNamespaces require such an orthogonal behavior.

Caio Lima

I changed it to use `MODULE_NAMESPACE` now. The design idea here is that when in this state, it triggers evaluation for deferred module, and then continue the lookup to properly perform the operation. This looks better than before, because deferred and ordinary module namespaces share the same execution path, with just a difference of evaluation trigger when it's required.

Igor Sheludko

Acknowledged

Line 2668, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . unresolved

This should be reachable if super constructor returns module.
```
class A { constructor() { return ns; } };
class B extends A { constructor() { super(); super.x = 14; super.y = 44; } };
```

File src/runtime/runtime-forin.cc
Line 78, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . unresolved

IIRC, by this moment deferred module should be evaluated... Please add a DCHECK for documenting purposes.

Open in Gerrit

Related details

Attention is currently required from:
  • Caio Lima
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 17
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Caio Lima <caio...@igalia.com>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:19:07 +0000
unsatisfied_requirement
open
diffy

Caio Lima (Gerrit)

unread,
Jan 7, 2026, 12:14:32 PM (2 days ago) Jan 7
to Olivier Flückiger, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Igor Sheludko, Leszek Swirski and Olivier Flückiger

Caio Lima added 8 comments

File src/ic/ic.cc
Line 903, Patchset 17: DCHECK(ns->module()->status() != Module::kEvaluated);
Igor Sheludko . resolved

`DCHECK_EQ`

Caio Lima

Done

File src/objects/js-objects.cc
Line 182, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . resolved

I think the right thing would be to set state to NotFound and return undefined (as in JSPROXY case) for deferred module requiring evaluation.

Caio Lima

Done

Line 782, Patchset 17: JSDeferredModuleNamespace::EvaluateModuleSync(it->isolate(), holder);
Igor Sheludko . resolved

We need to handle exceptions:
```
RETURN_EXCEPTION_IF_EXCEPTION(it->isolate());
```

Caio Lima

Done

Line 1005, Patchset 17: // TODO(348660658): replace language mode
Igor Sheludko . resolved

Please revert these changes, having a link eases opening the bug tracker.

Caio Lima

Done

Line 3759, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . unresolved

Please double-check this case. I think we can get here via `[[DefineOwnProperty]]` (EnforceDefineSemantics::kDefine).

Caio Lima

I'm going to add test for those.

When using `Object.defineProperty`, this goes through https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-objects.cc;l=1200;drc=26caa21b2ca37db2138418593e1db8a9832f0937 before reaching here.

The other case I also tested is the following:

```
class A { constructor() { return ns; } };
class B extends A {
  prop1 = 42;
};
```

In this case, it will take the `DefineNamedOwnProperty` opcode and then fail before calling `DefineOwnPropertyIgnoreAttributes`. In this case, I think we should consider this to be unreachable for `MODULE_NAMESPACE`. WDYT?

File src/objects/keys.cc
Line 1212, Patchset 17: RETURN_VALUE_IF_EXCEPTION(isolate_, Nothing<bool>());
Igor Sheludko . resolved

Nit: `RETURN_EXCEPTION_IF_EXCEPTION(isolate_);` would be nicer.

Caio Lima

Done

File src/objects/objects.cc
Line 2668, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . resolved

This should be reachable if super constructor returns module.
```
class A { constructor() { return ns; } };
class B extends A { constructor() { super(); super.x = 14; super.y = 44; } };
```

Caio Lima

Done

File src/runtime/runtime-forin.cc
Line 78, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . resolved

IIRC, by this moment deferred module should be evaluated... Please add a DCHECK for documenting purposes.

Caio Lima

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Igor Sheludko
  • Leszek Swirski
  • Olivier Flückiger
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 18
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Olivier Flückiger <ol...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Wed, 07 Jan 2026 17:14:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Igor Sheludko <ish...@chromium.org>
unsatisfied_requirement
open
diffy

Olivier Flückiger (Gerrit)

unread,
Jan 8, 2026, 9:54:43 AM (20 hours ago) Jan 8
to Caio Lima, Igor Sheludko, V8 LUCI CQ, Leszek Swirski, Nicolò Ribaudo, Hannes Payer, dmercadi...@chromium.org, mlippau...@chromium.org, v8-re...@googlegroups.com, was...@google.com
Attention needed from Caio Lima, Igor Sheludko and Leszek Swirski

Olivier Flückiger added 1 comment

File src/objects/js-objects.cc
Line 3759, Patchset 17: case LookupIterator::MODULE_NAMESPACE:
Igor Sheludko . unresolved

Please double-check this case. I think we can get here via `[[DefineOwnProperty]]` (EnforceDefineSemantics::kDefine).

Caio Lima

I'm going to add test for those.

When using `Object.defineProperty`, this goes through https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-objects.cc;l=1200;drc=26caa21b2ca37db2138418593e1db8a9832f0937 before reaching here.

The other case I also tested is the following:

```
class A { constructor() { return ns; } };
class B extends A {
prop1 = 42;
};
```

In this case, it will take the `DefineNamedOwnProperty` opcode and then fail before calling `DefineOwnPropertyIgnoreAttributes`. In this case, I think we should consider this to be unreachable for `MODULE_NAMESPACE`. WDYT?

Olivier Flückiger

I think I agree, except for builtins like %DefineKeyedOwnPropertyInLiteral. So as long we are not fuzzing them that should be ok.

Open in Gerrit

Related details

Attention is currently required from:
  • Caio Lima
  • Igor Sheludko
  • Leszek Swirski
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: v8/v8
Gerrit-Branch: main
Gerrit-Change-Id: I49a3a8e39bce0cb14ee2c032f6f7ff4d769c227f
Gerrit-Change-Number: 7247865
Gerrit-PatchSet: 19
Gerrit-Owner: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Caio Lima <caio...@igalia.com>
Gerrit-Reviewer: Igor Sheludko <ish...@chromium.org>
Gerrit-Reviewer: Leszek Swirski <les...@chromium.org>
Gerrit-Reviewer: Olivier Flückiger <ol...@chromium.org>
Gerrit-CC: Hannes Payer <hpa...@chromium.org>
Gerrit-CC: Nicolò Ribaudo <nrib...@igalia.com>
Gerrit-Attention: Caio Lima <caio...@igalia.com>
Gerrit-Attention: Igor Sheludko <ish...@chromium.org>
Gerrit-Attention: Leszek Swirski <les...@chromium.org>
Gerrit-Comment-Date: Thu, 08 Jan 2026 14:54:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages