Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 812b126

Browse filesBrowse files
targosrichardlau
authored andcommitted
deps: V8: cherry-pick d90d4533b053
Original commit message: Fix reading integer-indexed import assertions in dynamic import Use GetPropertyOrElement instead of GetProperty to read import assertion values from the import assertions object, to support cases in which the key is an integer index such as `"0"`. The added test case, when using GetProperty, triggers the following DCHECK in debug builds: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/lookup-inl.h;l=108;drc=515f187ba067ee4a99fdf5198cca2c97abd342fd In release builds it silently fails to read the property, and thus throws about it not being a valid string. Bug: v8:14069 Change-Id: Ifd4645b7bd9bfd07f06fa33727441d27eabc4d32 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4614489 Reviewed-by: Victor Gomes <victorgomes@chromium.org> Commit-Queue: Marja Hölttä <marja@chromium.org> Reviewed-by: Marja Hölttä <marja@chromium.org> Cr-Commit-Position: refs/heads/main@{#88267} Refs: v8/v8@d90d453 PR-URL: #50077 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent 9ab8c3d commit 812b126
Copy full SHA for 812b126

3 files changed

+8-3Lines changed: 8 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎common.gypi‎

Copy file name to clipboardExpand all lines: common.gypi
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.35',
39+
'v8_embedder_string': '-node.36',
4040

4141
##### V8 defaults for Node.js #####
4242

Collapse file

‎deps/v8/src/execution/isolate.cc‎

Copy file name to clipboardExpand all lines: deps/v8/src/execution/isolate.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4796,8 +4796,8 @@ MaybeHandle<FixedArray> Isolate::GetImportAssertionsFromArgument(
47964796
for (int i = 0; i < assertion_keys->length(); i++) {
47974797
Handle<String> assertion_key(String::cast(assertion_keys->get(i)), this);
47984798
Handle<Object> assertion_value;
4799-
if (!JSReceiver::GetProperty(this, import_assertions_object_receiver,
4800-
assertion_key)
4799+
if (!Object::GetPropertyOrElement(this, import_assertions_object_receiver,
4800+
assertion_key)
48014801
.ToHandle(&assertion_value)) {
48024802
// This can happen if the property has a getter function that throws
48034803
// an error.
Collapse file

‎deps/v8/test/mjsunit/harmony/modules-import-assertions-dynamic-6.mjs‎

Copy file name to clipboardExpand all lines: deps/v8/test/mjsunit/harmony/modules-import-assertions-dynamic-6.mjs
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ var life;
88
import('modules-skip-1.json', { assert: { type: 'json', notARealAssertion: 'value' } }).then(
99
namespace => life = namespace.default.life);
1010

11+
var life2;
12+
import('modules-skip-1.json', { assert: { 0: 'value', type: 'json' } }).then(
13+
namespace => life2 = namespace.default.life);
14+
1115
%PerformMicrotaskCheckpoint();
1216

1317
assertEquals(42, life);
18+
assertEquals(42, life2);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.