| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent db57f0a commit 5a5f6bb
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | 39 | # Reset this number to 0 on major V8 upgrades. | |
| 40 | 40 | # Increment by one for each non-official patch applied to deps/v8. | |
| 41 | - 'v8_embedder_string': '-node.13', | ||
| 41 | + 'v8_embedder_string': '-node.14', | ||
| 42 | 42 | ||
| 43 | 43 | ##### V8 defaults for Node.js ##### | |
| 44 | 44 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1165,16 +1165,18 @@ class ParserBase { | |||
| 1165 | 1165 | } | |
| 1166 | 1166 | bool is_using_allowed() const { | |
| 1167 | 1167 | // UsingDeclaration and AwaitUsingDeclaration are Syntax Errors if the goal | |
| 1168 | - // symbol is Script. UsingDeclaration and AwaitUsingDeclaration are not | ||
| 1169 | - // contained, either directly or indirectly, within a Block, CaseBlock, | ||
| 1170 | - // ForStatement, ForInOfStatement, FunctionBody, GeneratorBody, | ||
| 1168 | + // symbol is Script. UsingDeclaration and AwaitUsingDeclaration are Syntax | ||
| 1169 | + // Errors if they are not contained, either directly or indirectly, within a | ||
| 1170 | + // Block, ForStatement, ForInOfStatement, FunctionBody, GeneratorBody, | ||
| 1171 | 1171 | // AsyncGeneratorBody, AsyncFunctionBody, ClassStaticBlockBody, or | |
| 1172 | - // ClassBody. Unless the current scope's ScopeType is ScriptScope, the | ||
| 1172 | + // ClassBody. They are disallowed in 'bare' switch cases. | ||
| 1173 | + // Unless the current scope's ScopeType is ScriptScope, the | ||
| 1173 | 1174 | // current position is directly or indirectly within one of the productions | |
| 1174 | 1175 | // listed above since they open a new scope. | |
| 1175 | - return ((scope()->scope_type() != SCRIPT_SCOPE && | ||
| 1176 | - scope()->scope_type() != EVAL_SCOPE) || | ||
| 1177 | - scope()->scope_type() == REPL_MODE_SCOPE); | ||
| 1176 | + return (((scope()->scope_type() != SCRIPT_SCOPE && | ||
| 1177 | + scope()->scope_type() != EVAL_SCOPE) || | ||
| 1178 | + scope()->scope_type() == REPL_MODE_SCOPE) && | ||
| 1179 | + !scope()->is_nonlinear()); | ||
| 1178 | 1180 | } | |
| 1179 | 1181 | bool IsNextUsingKeyword(Token::Value token_after_using, bool is_await_using) { | |
| 1180 | 1182 | // using and await using declarations in for-of statements must be followed | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1277,6 +1277,10 @@ | |||
| 1277 | 1277 | # May OOM fatally | |
| 1278 | 1278 | 'staging/sm/regress/regress-610026': [SKIP], | |
| 1279 | 1279 | ||
| 1280 | + # https://github.com/rbuckton/ecma262/pull/14 | ||
| 1281 | + 'staging/explicit-resource-management/await-using-in-switch-case-block': [SKIP], | ||
| 1282 | + 'staging/explicit-resource-management/call-dispose-methods': [SKIP], | ||
| 1283 | + | ||
| 1280 | 1284 | ############################ SLOW TESTS ############################# | |
| 1281 | 1285 | ||
| 1282 | 1286 | 'annexB/built-ins/RegExp/RegExp-leading-escape-BMP': [PASS, SLOW], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1082,6 +1082,24 @@ TEST_F(DeclsTest, TestUsing) { | |||
| 1082 | 1082 | EXPECT_ERROR); | |
| 1083 | 1083 | context.Check("{var using; \n using = 42;}", EXPECT_RESULT, | |
| 1084 | 1084 | Number::New(isolate(), 42)); | |
| 1085 | + context.Check( | ||
| 1086 | + "let label = \"1\"; \n switch (label) { \n case 1: \n let y = 2; \n" | ||
| 1087 | + "using x = { \n " | ||
| 1088 | + " value: 1, \n " | ||
| 1089 | + " [Symbol.dispose]() { \n " | ||
| 1090 | + " return 42; \n " | ||
| 1091 | + " } \n " | ||
| 1092 | + " }; }", | ||
| 1093 | + EXPECT_ERROR); | ||
| 1094 | + context.Check( | ||
| 1095 | + "let label = \"1\"; \n switch (label) { \n case 1: {\n let y = 2; \n" | ||
| 1096 | + "using x = { \n " | ||
| 1097 | + " value: 1, \n " | ||
| 1098 | + " [Symbol.dispose]() { \n " | ||
| 1099 | + " return 42; \n " | ||
| 1100 | + " } \n " | ||
| 1101 | + " }; } }", | ||
| 1102 | + EXPECT_RESULT, Undefined(isolate())); | ||
| 1085 | 1103 | } | |
| 1086 | 1104 | } | |
| 1087 | 1105 | ||
@@ -1144,6 +1162,17 @@ TEST_F(DeclsTest, TestAwaitUsing) { | |||
| 1144 | 1162 | " } } \n " | |
| 1145 | 1163 | " f(); ", | |
| 1146 | 1164 | EXPECT_ERROR); | |
| 1165 | + context.Check( | ||
| 1166 | + "async function f() {let label = \"1\"; \n switch (label){ \n case 1: " | ||
| 1167 | + "\n let y = 2;" | ||
| 1168 | + "\n await using x = { \n " | ||
| 1169 | + " value: 1, \n " | ||
| 1170 | + " [Symbol.asyncDispose]() { \n " | ||
| 1171 | + " classStaticBlockBodyValues.push(42); \n " | ||
| 1172 | + " } \n " | ||
| 1173 | + " }; \n }" | ||
| 1174 | + "} \n f();", | ||
| 1175 | + EXPECT_ERROR); | ||
| 1147 | 1176 | } | |
| 1148 | 1177 | } | |
| 1149 | 1178 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments