Skip to content

Commit 894419c

Browse files
bdougietargos
authored andcommitted
deps: V8: backport 4263f8a5e8e0
Original commit message: parser: better error message for await+tla Bug: v8:9344, v8:6513 Change-Id: I1854e483515e7da99192367b6764a0ec7c8b41d9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2411687 Reviewed-by: Marja Hölttä <[email protected]> Commit-Queue: Gus Caplan <[email protected]> Cr-Commit-Position: refs/heads/master@{#70099} Refs: v8/v8@4263f8a PR-URL: #35650 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent a7f37bc commit 894419c

File tree

6 files changed

+23
-18
lines changed

6 files changed

+23
-18
lines changed

common.gypi

+1-1
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.15',
39+
'v8_embedder_string': '-node.16',
4040

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

deps/v8/src/common/message-template.h

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ namespace internal {
3333
"Derived ArrayBuffer constructor created a buffer which was too small") \
3434
T(ArrayBufferSpeciesThis, \
3535
"ArrayBuffer subclass returned this from species constructor") \
36+
T(AwaitNotInAsyncContext, \
37+
"await is only valid in async functions and the top level bodies of " \
38+
"modules") \
3639
T(AwaitNotInAsyncFunction, "await is only valid in async function") \
3740
T(AtomicsWaitNotAllowed, "Atomics.wait cannot be called in this context") \
3841
T(BadSortComparisonFunction, \

deps/v8/src/parsing/parser-base.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,9 @@ class ParserBase {
909909

910910
if (scanner()->current_token() == Token::AWAIT && !is_async_function()) {
911911
ReportMessageAt(scanner()->location(),
912-
MessageTemplate::kAwaitNotInAsyncFunction);
912+
flags().allow_harmony_top_level_await()
913+
? MessageTemplate::kAwaitNotInAsyncContext
914+
: MessageTemplate::kAwaitNotInAsyncFunction);
913915
return;
914916
}
915917

deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateAccessorAccess.golden

+4-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bytecodes: [
8484
B(Mov), R(this), R(0),
8585
B(Mov), R(context), R(2),
8686
/* 48 E> */ B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(3),
87-
/* 53 S> */ B(Wide), B(LdaSmi), I16(266),
87+
/* 53 S> */ B(Wide), B(LdaSmi), I16(267),
8888
B(Star), R(3),
8989
B(LdaConstant), U8(0),
9090
B(Star), R(4),
@@ -115,7 +115,7 @@ bytecodes: [
115115
B(Mov), R(this), R(0),
116116
B(Mov), R(context), R(2),
117117
/* 41 E> */ B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(3),
118-
/* 46 S> */ B(Wide), B(LdaSmi), I16(265),
118+
/* 46 S> */ B(Wide), B(LdaSmi), I16(266),
119119
B(Star), R(3),
120120
B(LdaConstant), U8(0),
121121
B(Star), R(4),
@@ -146,7 +146,7 @@ bytecodes: [
146146
B(Mov), R(this), R(0),
147147
B(Mov), R(context), R(2),
148148
/* 48 E> */ B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(3),
149-
/* 53 S> */ B(Wide), B(LdaSmi), I16(266),
149+
/* 53 S> */ B(Wide), B(LdaSmi), I16(267),
150150
B(Star), R(3),
151151
B(LdaConstant), U8(0),
152152
B(Star), R(4),
@@ -177,7 +177,7 @@ bytecodes: [
177177
B(Mov), R(this), R(0),
178178
B(Mov), R(context), R(2),
179179
/* 41 E> */ B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(3),
180-
/* 46 S> */ B(Wide), B(LdaSmi), I16(265),
180+
/* 46 S> */ B(Wide), B(LdaSmi), I16(266),
181181
B(Star), R(4),
182182
B(LdaConstant), U8(0),
183183
B(Star), R(5),

deps/v8/test/cctest/interpreter/bytecode_expectations/PrivateMethodAccess.golden

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bytecodes: [
5757
B(Mov), R(this), R(0),
5858
B(Mov), R(context), R(2),
5959
/* 44 E> */ B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(3),
60-
/* 49 S> */ B(Wide), B(LdaSmi), I16(264),
60+
/* 49 S> */ B(Wide), B(LdaSmi), I16(265),
6161
B(Star), R(3),
6262
B(LdaConstant), U8(0),
6363
B(Star), R(4),
@@ -89,7 +89,7 @@ bytecodes: [
8989
B(Mov), R(this), R(0),
9090
B(Mov), R(context), R(2),
9191
/* 44 E> */ B(CallRuntime), U16(Runtime::kAddPrivateBrand), R(0), U8(3),
92-
/* 49 S> */ B(Wide), B(LdaSmi), I16(264),
92+
/* 49 S> */ B(Wide), B(LdaSmi), I16(265),
9393
B(Star), R(3),
9494
B(LdaConstant), U8(0),
9595
B(Star), R(4),

deps/v8/test/cctest/interpreter/bytecode_expectations/StaticPrivateMethodAccess.golden

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bytecodes: [
2525
B(TestReferenceEqual), R(this),
2626
B(Mov), R(this), R(1),
2727
B(JumpIfTrue), U8(18),
28-
B(Wide), B(LdaSmi), I16(262),
28+
B(Wide), B(LdaSmi), I16(263),
2929
B(Star), R(2),
3030
B(LdaConstant), U8(0),
3131
B(Star), R(3),
@@ -56,7 +56,7 @@ frame size: 2
5656
parameter count: 1
5757
bytecode array length: 16
5858
bytecodes: [
59-
/* 56 S> */ B(Wide), B(LdaSmi), I16(264),
59+
/* 56 S> */ B(Wide), B(LdaSmi), I16(265),
6060
B(Star), R(0),
6161
B(LdaConstant), U8(0),
6262
B(Star), R(1),
@@ -83,7 +83,7 @@ frame size: 2
8383
parameter count: 1
8484
bytecode array length: 16
8585
bytecodes: [
86-
/* 56 S> */ B(Wide), B(LdaSmi), I16(264),
86+
/* 56 S> */ B(Wide), B(LdaSmi), I16(265),
8787
B(Star), R(0),
8888
B(LdaConstant), U8(0),
8989
B(Star), R(1),
@@ -122,7 +122,7 @@ bytecodes: [
122122
/* 94 E> */ B(TestReferenceEqual), R(this),
123123
B(Mov), R(this), R(0),
124124
B(JumpIfTrue), U8(18),
125-
B(Wide), B(LdaSmi), I16(262),
125+
B(Wide), B(LdaSmi), I16(263),
126126
B(Star), R(2),
127127
B(LdaConstant), U8(0),
128128
B(Star), R(3),
@@ -144,7 +144,7 @@ bytecodes: [
144144
/* 109 E> */ B(TestReferenceEqual), R(this),
145145
B(Mov), R(this), R(1),
146146
B(JumpIfTrue), U8(18),
147-
B(Wide), B(LdaSmi), I16(263),
147+
B(Wide), B(LdaSmi), I16(264),
148148
B(Star), R(3),
149149
B(LdaConstant), U8(0),
150150
B(Star), R(4),
@@ -159,7 +159,7 @@ bytecodes: [
159159
/* 133 E> */ B(TestReferenceEqual), R(this),
160160
B(Mov), R(this), R(0),
161161
B(JumpIfTrue), U8(18),
162-
B(Wide), B(LdaSmi), I16(262),
162+
B(Wide), B(LdaSmi), I16(263),
163163
B(Star), R(2),
164164
B(LdaConstant), U8(0),
165165
B(Star), R(3),
@@ -189,7 +189,7 @@ frame size: 2
189189
parameter count: 1
190190
bytecode array length: 16
191191
bytecodes: [
192-
/* 60 S> */ B(Wide), B(LdaSmi), I16(266),
192+
/* 60 S> */ B(Wide), B(LdaSmi), I16(267),
193193
B(Star), R(0),
194194
B(LdaConstant), U8(0),
195195
B(Star), R(1),
@@ -215,7 +215,7 @@ frame size: 2
215215
parameter count: 1
216216
bytecode array length: 16
217217
bytecodes: [
218-
/* 53 S> */ B(Wide), B(LdaSmi), I16(265),
218+
/* 53 S> */ B(Wide), B(LdaSmi), I16(266),
219219
B(Star), R(0),
220220
B(LdaConstant), U8(0),
221221
B(Star), R(1),
@@ -241,7 +241,7 @@ frame size: 2
241241
parameter count: 1
242242
bytecode array length: 16
243243
bytecodes: [
244-
/* 60 S> */ B(Wide), B(LdaSmi), I16(266),
244+
/* 60 S> */ B(Wide), B(LdaSmi), I16(267),
245245
B(Star), R(0),
246246
B(LdaConstant), U8(0),
247247
B(Star), R(1),
@@ -267,7 +267,7 @@ frame size: 3
267267
parameter count: 1
268268
bytecode array length: 16
269269
bytecodes: [
270-
/* 46 S> */ B(Wide), B(LdaSmi), I16(265),
270+
/* 46 S> */ B(Wide), B(LdaSmi), I16(266),
271271
B(Star), R(1),
272272
B(LdaConstant), U8(0),
273273
B(Star), R(2),

0 commit comments

Comments
 (0)