Skip to content

Commit

Permalink
deps: V8: cherry-pick ae5a4db8ad86
Browse files Browse the repository at this point in the history
Original commit message:

    [import-attributes] Deprecate 'assert' for removal in 12.6

    See https://groups.google.com/a/chromium.org/g/blink-dev/c/ZHvzLaJZRvo/m/FgNDBjrtBQAJ

    Bug: v8:10958
    Change-Id: I4d21c9f7aad1024b198b4a1cdfb4792a011da464
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5055681
    Reviewed-by: Rezvan Mahdavi Hezaveh <[email protected]>
    Auto-Submit: Shu-yu Guo <[email protected]>
    Commit-Queue: Shu-yu Guo <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#92044}

Refs: v8/v8@ae5a4db
  • Loading branch information
aduh95 committed Nov 15, 2024
1 parent 14b6317 commit 799abbf
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.37',
'v8_embedder_string': '-node.38',

##### V8 defaults for Node.js #####

Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/common/message-template.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ namespace internal {
T(IllegalInvocation, "Illegal invocation") \
T(ImmutablePrototypeSet, \
"Immutable prototype object '%' cannot have their prototype set") \
T(ImportAssertDeprecated, \
"'assert' is deprecated in import statements and support will be removed " \
"in %; use 'with' instead") \
T(ImportAssertionDuplicateKey, "Import assertion has duplicate key '%'") \
T(ImportCallNotNewExpression, "Cannot use new with import") \
T(ImportOutsideModule, "Cannot use import statement outside a module") \
Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/parsing/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,9 @@ ImportAssertions* Parser::ParseImportAssertClause() {

// NOTE(Node.js): Commented out to avoid backporting this use counter to Node.js 18
// ++use_counts_[v8::Isolate::kImportAssertionDeprecatedSyntax];
info_->pending_error_handler()->ReportWarningAt(
position(), end_position(), MessageTemplate::kImportAssertDeprecated,
"a future version");
} else {
return import_assertions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ bytecodes: [
/* 48 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0),
/* 53 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 58 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(297),
B(Wide), B(LdaSmi), I16(298),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
Expand Down Expand Up @@ -115,7 +115,7 @@ bytecodes: [
/* 41 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0),
/* 46 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 51 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(296),
B(Wide), B(LdaSmi), I16(297),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
Expand Down Expand Up @@ -149,7 +149,7 @@ bytecodes: [
B(Star2),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 58 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(297),
B(Wide), B(LdaSmi), I16(298),
B(Star3),
B(LdaConstant), U8(0),
B(Star4),
Expand Down Expand Up @@ -181,7 +181,7 @@ bytecodes: [
/* 41 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0),
/* 46 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 51 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(296),
B(Wide), B(LdaSmi), I16(297),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bytecodes: [
B(Star2),
B(LdaImmutableCurrentContextSlot), U8(3),
/* 54 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(295),
B(Wide), B(LdaSmi), I16(296),
B(Star3),
B(LdaConstant), U8(0),
B(Star4),
Expand Down Expand Up @@ -91,7 +91,7 @@ bytecodes: [
/* 44 E> */ B(DefineKeyedOwnProperty), R(this), R(0), U8(0),
/* 49 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 54 E> */ B(GetKeyedProperty), R(this), U8(2),
B(Wide), B(LdaSmi), I16(295),
B(Wide), B(LdaSmi), I16(296),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(1),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
Expand Down Expand Up @@ -61,13 +61,13 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
/* 61 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(295),
B(Wide), B(LdaSmi), I16(296),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
Expand Down Expand Up @@ -99,13 +99,13 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
/* 61 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(295),
B(Wide), B(LdaSmi), I16(296),
B(Star1),
B(LdaConstant), U8(1),
B(Star2),
Expand Down Expand Up @@ -145,7 +145,7 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
Expand All @@ -167,7 +167,7 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star3),
B(LdaConstant), U8(0),
B(Star4),
Expand All @@ -182,7 +182,7 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
Expand Down Expand Up @@ -216,13 +216,13 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
/* 65 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(297),
B(Wide), B(LdaSmi), I16(298),
B(Star1),
B(LdaConstant), U8(1),
B(Star2),
Expand Down Expand Up @@ -253,13 +253,13 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
/* 58 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(1), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(296),
B(Wide), B(LdaSmi), I16(297),
B(Star1),
B(LdaConstant), U8(1),
B(Star2),
Expand Down Expand Up @@ -292,13 +292,13 @@ bytecodes: [
B(TestReferenceEqual), R(this),
B(Mov), R(this), R(0),
B(JumpIfTrue), U8(16),
B(Wide), B(LdaSmi), I16(289),
B(Wide), B(LdaSmi), I16(290),
B(Star2),
B(LdaConstant), U8(0),
B(Star3),
/* 65 E> */ B(CallRuntime), U16(Runtime::kNewTypeError), R(2), U8(2),
B(Throw),
B(Wide), B(LdaSmi), I16(297),
B(Wide), B(LdaSmi), I16(298),
B(Star2),
B(LdaConstant), U8(1),
B(Star3),
Expand Down Expand Up @@ -327,7 +327,7 @@ bytecode array length: 19
bytecodes: [
/* 46 S> */ B(LdaImmutableCurrentContextSlot), U8(3),
/* 51 E> */ B(GetKeyedProperty), R(this), U8(0),
B(Wide), B(LdaSmi), I16(296),
B(Wide), B(LdaSmi), I16(297),
B(Star1),
B(LdaConstant), U8(0),
B(Star2),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
undefined:1: SyntaxError: Unexpected token / in JSON at position 0
*%(basename)s:9: 'assert' is deprecated in import statements and support will be removed in future version; use 'with' instead
undefined:1: SyntaxError: Unexpected token '/', "// Copyrig"... is not valid JSON
// Copyright 2021 the V8 project authors. All rights reserved.
^
SyntaxError: Unexpected token / in JSON at position 0
SyntaxError: Unexpected token '/', "// Copyrig"... is not valid JSON

0 comments on commit 799abbf

Please sign in to comment.