Chromium Code Reviews| Index: test/cctest/test-parsing.cc |
| diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
| index a59566bd8003ac5175acbff69fccf0d867395204..aef40c3908416a8e3cfa11f9bb6d7e3a96a1cbaf 100644 |
| --- a/test/cctest/test-parsing.cc |
| +++ b/test/cctest/test-parsing.cc |
| @@ -4898,6 +4898,36 @@ TEST(ParseRestParametersErrors) { |
| } |
| +TEST(SpreadCall) { |
| + const char* context_data[][2] = {{"function fn() { 'use strict';} fn(", ");"}, |
| + {"function fn() {} fn(", ");"}, |
| + {NULL, NULL}}; |
| + |
| + const char* data[] = { |
| + "...([1, 2, 3])", |
| + "...'123', ...'456'", |
| + "...new Set([1, 2, 3]), 4", |
| + "1, ...[2, 3], 4", |
| + "...Array(...[1,2,3,4])", |
| + "...NaN", |
| + NULL}; |
| + RunParserSyncTest(context_data, data, kSuccess, NULL, 0, NULL, 0); |
| +} |
| + |
| + |
| +TEST(SpreadCallErrors) { |
| + const char* context_data[][2] = {{"function fn() { 'use strict';} fn(", ");"}, |
| + {"function fn() {} fn(", ");"}, |
| + {NULL, NULL}}; |
| + |
| + const char* data[] = { |
| + "(...[1, 2, 3])", |
| + "......[1,2,3]", |
|
arv (Not doing code reviews)
2015/02/12 21:41:34
maybe a test for ... outside Arguments?
caitp (gmail)
2015/02/12 21:58:54
will do
|
| + NULL}; |
| + RunParserSyncTest(context_data, data, kError, NULL, 0, NULL, 0); |
| +} |
| + |
| + |
| TEST(LexicalScopingSloppyMode) { |
| const char* context_data[][2] = { |
| {"", ""}, |