Chromium Code Reviews| Index: test/cctest/test-parsing.cc |
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
| index 12c6a4012d2e1d5a8422e464af1c56af519e3dea..a54688f5fc69fdad41a0f85932fa58e6b79a3d33 100644 |
| --- a/test/cctest/test-parsing.cc |
| +++ b/test/cctest/test-parsing.cc |
| @@ -6345,6 +6345,37 @@ TEST(DestructuringPositiveTests) { |
| NULL}; |
| // clang-format on |
| RunParserSyncTest(context_data, data, kSuccess); |
| + |
| + // v8:5201 |
| + { |
| + const char* sloppy_context_data[][2] = { |
| + {"", ""}, |
| + {NULL, NULL} |
| + }; |
| + const char* data1[] = { |
| + "var {arguments} = {}", |
| + "var {eval} = {}", |
| + "var {x: arguments} = {x: 5}", |
| + "var {x: eval} = {x: 5}", |
| + "function f({eval = false } = {}) {}", |
| + "function f(argument1, {eval = false} = {}) {}", |
| + "function f(argument1, {eval} = {}) {}", |
|
adamk
2016/08/19 18:14:56
Rather than enumerating different surrounding stuf
lpy
2016/08/19 18:58:17
Done.
|
| + NULL, |
| + }; |
| + RunParserSyncTest(sloppy_context_data, data1, kSuccess); |
| + |
| + const char* empty_context_data[][2] = { |
| + {"'use strict';", ""}, |
| + {"", ""}, |
| + {NULL, NULL} |
| + }; |
| + const char* data2[] = { |
| + "var {arguments: x} = {argumnets: 1};", |
| + "var {eval: x} = {eval: 1};", |
|
adamk
2016/08/19 18:14:56
These two tests can just go in the main block of t
lpy
2016/08/19 18:58:17
Done.
|
| + NULL |
| + }; |
| + RunParserSyncTest(empty_context_data, data2, kSuccess); |
| + } |
| } |
| @@ -6457,6 +6488,7 @@ TEST(DestructuringNegativeTests) { |
| { // Strict mode. |
| const char* context_data[][2] = { |
| + {"'use strict'; var ", " = {};"}, |
| {"'use strict'; let ", " = {};"}, |
| {"'use strict'; const ", " = {};"}, |
| {"'use strict'; function f(", ") {}"}, |
| @@ -6465,10 +6497,18 @@ TEST(DestructuringNegativeTests) { |
| // clang-format off |
| const char* data[] = { |
| + "[arguments]", |
| "[eval]", |
| "{ a : arguments }", |
| + "{ a : eval }", |
| "[public]", |
| "{ x : private }", |
| + "{ x : arguments }", |
| + "{ x : eval }", |
| + "{ arguments }", |
| + "{ eval }", |
| + "{ arguments = false }" |
| + "{ eval = false }", |
| NULL}; |
| // clang-format on |
| RunParserSyncTest(context_data, data, kError); |