Skip to content

Commit ff9c811

Browse files
bdougieMylesBorins
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
1 parent d5088d8 commit ff9c811

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
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),

0 commit comments

Comments
 (0)