Chromium Code Reviews| Index: test/cctest/test-parsing.cc |
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
| index 3adeecfbf82303f97be5dd6e602544003934b279..b528a96be5628059fc0af3d1117ed25645bd42eb 100644 |
| --- a/test/cctest/test-parsing.cc |
| +++ b/test/cctest/test-parsing.cc |
| @@ -6363,23 +6363,38 @@ TEST(DestructuringPositiveTests) { |
| // clang-format off |
| const char* data[] = { |
| + "x", |
|
arv (Not doing code reviews)
2015/05/18 14:36:20
this is a duplicate of the next line
Dmitry Lomov (no reviews)
2015/05/18 17:31:23
Done.
|
| "a", |
| "{ x : y }", |
| + "{ x : y = 1 }", |
| "[a]", |
| + "[a = 1]", |
| "[a,b,c]", |
| + "[a, b = 42, c]", |
| "{ x : x, y : y }", |
| + "{ x : x = 1, y : y }", |
| + "{ x : x, y : y = 42 }", |
| "[]", |
| "{}", |
| "[{x:x, y:y}, [a,b,c]]", |
| + "[{x:x = 1, y:y = 2}, [a = 3, b = 4, c = 5]]", |
| + "{x}", |
| + "{x, y}", |
| + "{x = 42, y = 15}", |
| "[a,,b]", |
| "{42 : x}", |
| + "{42 : x = 42}", |
| "{42e-2 : x}", |
| + "{42e-2 : x = 42}", |
| "{'hi' : x}", |
| + "{'hi' : x = 42}", |
| "{var: x}", |
| + "{var: x = 42}", |
|
rossberg
2015/05/18 16:17:19
Add a test with computed property names.
Dmitry Lomov (no reviews)
2015/05/18 17:31:22
I want to cover computed property names in a separ
|
| "{}", |
| NULL}; |
| // clang-format on |
| - static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring}; |
| + static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals, |
| + kAllowHarmonyDestructuring}; |
| RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
| arraysize(always_flags)); |
| } |
| @@ -6387,7 +6402,8 @@ TEST(DestructuringPositiveTests) { |
| TEST(DestructuringNegativeTests) { |
| i::FLAG_harmony_destructuring = true; |
| - static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring}; |
| + static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals, |
| + kAllowHarmonyDestructuring}; |
| { // All modes. |
| const char* context_data[][2] = {{"'use strict'; let ", " = {};"}, |
| @@ -6439,6 +6455,9 @@ TEST(DestructuringNegativeTests) { |
| "var", |
| "[var]", |
| "{x : {y : var}}", |
| + "{x : x = a+}", |
| + "{x : x = (a+)}", |
| + "{x : x += a}", |
|
rossberg
2015/05/18 16:17:19
Add a test with method syntax, e.g. "{m() {} = 0}"
Dmitry Lomov (no reviews)
2015/05/18 17:31:22
Done.
|
| NULL}; |
| // clang-format on |
| RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |