OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6371 "[a,b,c]", | 6371 "[a,b,c]", |
6372 "{ x : x, y : y }", | 6372 "{ x : x, y : y }", |
6373 "[]", | 6373 "[]", |
6374 "{}", | 6374 "{}", |
6375 "[{x:x, y:y}, [a,b,c]]", | 6375 "[{x:x, y:y}, [a,b,c]]", |
6376 "[a,,b]", | 6376 "[a,,b]", |
6377 "{42 : x}", | 6377 "{42 : x}", |
6378 "{42e-2 : x}", | 6378 "{42e-2 : x}", |
6379 "{'hi' : x}", | 6379 "{'hi' : x}", |
6380 "{var: x}", | 6380 "{var: x}", |
| 6381 "{}", |
6381 NULL}; | 6382 NULL}; |
6382 // clang-format on | 6383 // clang-format on |
6383 static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring}; | 6384 static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring}; |
6384 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, | 6385 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
6385 arraysize(always_flags)); | 6386 arraysize(always_flags)); |
6386 } | 6387 } |
6387 | 6388 |
6388 | 6389 |
6389 TEST(DestructuringNegativeTests) { | 6390 TEST(DestructuringNegativeTests) { |
6390 i::FLAG_harmony_destructuring = true; | 6391 i::FLAG_harmony_destructuring = true; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6474 const char* data[] = { | 6475 const char* data[] = { |
6475 "yield", | 6476 "yield", |
6476 "[yield]", | 6477 "[yield]", |
6477 "{ x : yield }", | 6478 "{ x : yield }", |
6478 NULL}; | 6479 NULL}; |
6479 // clang-format on | 6480 // clang-format on |
6480 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, | 6481 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
6481 arraysize(always_flags)); | 6482 arraysize(always_flags)); |
6482 } | 6483 } |
6483 } | 6484 } |
OLD | NEW |