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 6461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6472 {"function f(argument1, ", ") {}"}, | 6472 {"function f(argument1, ", ") {}"}, |
6473 {"var f = (", ") => {};"}, | 6473 {"var f = (", ") => {};"}, |
6474 {"var f = (argument1,", ") => {};"}, | 6474 {"var f = (argument1,", ") => {};"}, |
6475 {NULL, NULL}}; | 6475 {NULL, NULL}}; |
6476 | 6476 |
6477 // clang-format off | 6477 // clang-format off |
6478 const char* data[] = { | 6478 const char* data[] = { |
6479 "a", | 6479 "a", |
6480 "{ x : y }", | 6480 "{ x : y }", |
6481 "{ x : y = 1 }", | 6481 "{ x : y = 1 }", |
| 6482 "{ get, set }", |
| 6483 "{ get = 1, set = 2 }", |
6482 "[a]", | 6484 "[a]", |
6483 "[a = 1]", | 6485 "[a = 1]", |
6484 "[a,b,c]", | 6486 "[a,b,c]", |
6485 "[a, b = 42, c]", | 6487 "[a, b = 42, c]", |
6486 "{ x : x, y : y }", | 6488 "{ x : x, y : y }", |
6487 "{ x : x = 1, y : y }", | 6489 "{ x : x = 1, y : y }", |
6488 "{ x : x, y : y = 42 }", | 6490 "{ x : x, y : y = 42 }", |
6489 "[]", | 6491 "[]", |
6490 "{}", | 6492 "{}", |
6491 "[{x:x, y:y}, [a,b,c]]", | 6493 "[{x:x, y:y}, [a,b,c]]", |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7167 "for (let in {}) {}", | 7169 "for (let in {}) {}", |
7168 NULL | 7170 NULL |
7169 }; | 7171 }; |
7170 // clang-format on | 7172 // clang-format on |
7171 | 7173 |
7172 static const ParserFlag always_flags[] = {kAllowHarmonySloppy, | 7174 static const ParserFlag always_flags[] = {kAllowHarmonySloppy, |
7173 kAllowHarmonySloppyLet}; | 7175 kAllowHarmonySloppyLet}; |
7174 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, | 7176 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
7175 arraysize(always_flags)); | 7177 arraysize(always_flags)); |
7176 } | 7178 } |
OLD | NEW |