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 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 } | 1424 } |
1425 | 1425 |
1426 | 1426 |
1427 enum ParserFlag { | 1427 enum ParserFlag { |
1428 kAllowLazy, | 1428 kAllowLazy, |
1429 kAllowNatives, | 1429 kAllowNatives, |
1430 kAllowHarmonyModules, | 1430 kAllowHarmonyModules, |
1431 kAllowHarmonyArrowFunctions, | 1431 kAllowHarmonyArrowFunctions, |
1432 kAllowHarmonyRestParameters, | 1432 kAllowHarmonyRestParameters, |
1433 kAllowHarmonySloppy, | 1433 kAllowHarmonySloppy, |
| 1434 kAllowHarmonySloppyLet, |
1434 kAllowHarmonyUnicode, | 1435 kAllowHarmonyUnicode, |
1435 kAllowHarmonyComputedPropertyNames, | 1436 kAllowHarmonyComputedPropertyNames, |
1436 kAllowHarmonySpreadCalls, | 1437 kAllowHarmonySpreadCalls, |
1437 kAllowHarmonyDestructuring, | 1438 kAllowHarmonyDestructuring, |
1438 kAllowHarmonySpreadArrays, | 1439 kAllowHarmonySpreadArrays, |
1439 kAllowHarmonyNewTarget, | 1440 kAllowHarmonyNewTarget, |
1440 kAllowStrongMode, | 1441 kAllowStrongMode, |
1441 kNoLegacyConst | 1442 kNoLegacyConst |
1442 }; | 1443 }; |
1443 | 1444 |
(...skipping 10 matching lines...) Expand all Loading... |
1454 parser->set_allow_lazy(flags.Contains(kAllowLazy)); | 1455 parser->set_allow_lazy(flags.Contains(kAllowLazy)); |
1455 parser->set_allow_natives(flags.Contains(kAllowNatives)); | 1456 parser->set_allow_natives(flags.Contains(kAllowNatives)); |
1456 parser->set_allow_harmony_modules(flags.Contains(kAllowHarmonyModules)); | 1457 parser->set_allow_harmony_modules(flags.Contains(kAllowHarmonyModules)); |
1457 parser->set_allow_harmony_arrow_functions( | 1458 parser->set_allow_harmony_arrow_functions( |
1458 flags.Contains(kAllowHarmonyArrowFunctions)); | 1459 flags.Contains(kAllowHarmonyArrowFunctions)); |
1459 parser->set_allow_harmony_rest_params( | 1460 parser->set_allow_harmony_rest_params( |
1460 flags.Contains(kAllowHarmonyRestParameters)); | 1461 flags.Contains(kAllowHarmonyRestParameters)); |
1461 parser->set_allow_harmony_spreadcalls( | 1462 parser->set_allow_harmony_spreadcalls( |
1462 flags.Contains(kAllowHarmonySpreadCalls)); | 1463 flags.Contains(kAllowHarmonySpreadCalls)); |
1463 parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy)); | 1464 parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy)); |
| 1465 parser->set_allow_harmony_sloppy_let(flags.Contains(kAllowHarmonySloppyLet)); |
1464 parser->set_allow_harmony_unicode(flags.Contains(kAllowHarmonyUnicode)); | 1466 parser->set_allow_harmony_unicode(flags.Contains(kAllowHarmonyUnicode)); |
1465 parser->set_allow_harmony_computed_property_names( | 1467 parser->set_allow_harmony_computed_property_names( |
1466 flags.Contains(kAllowHarmonyComputedPropertyNames)); | 1468 flags.Contains(kAllowHarmonyComputedPropertyNames)); |
1467 parser->set_allow_harmony_destructuring( | 1469 parser->set_allow_harmony_destructuring( |
1468 flags.Contains(kAllowHarmonyDestructuring)); | 1470 flags.Contains(kAllowHarmonyDestructuring)); |
1469 parser->set_allow_harmony_spread_arrays( | 1471 parser->set_allow_harmony_spread_arrays( |
1470 flags.Contains(kAllowHarmonySpreadArrays)); | 1472 flags.Contains(kAllowHarmonySpreadArrays)); |
1471 parser->set_allow_harmony_new_target(flags.Contains(kAllowHarmonyNewTarget)); | 1473 parser->set_allow_harmony_new_target(flags.Contains(kAllowHarmonyNewTarget)); |
1472 parser->set_allow_strong_mode(flags.Contains(kAllowStrongMode)); | 1474 parser->set_allow_strong_mode(flags.Contains(kAllowStrongMode)); |
1473 parser->set_allow_legacy_const(!flags.Contains(kNoLegacyConst)); | 1475 parser->set_allow_legacy_const(!flags.Contains(kNoLegacyConst)); |
(...skipping 5360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6834 const char* data[] = { | 6836 const char* data[] = { |
6835 "let x", | 6837 "let x", |
6836 "let x = 1", | 6838 "let x = 1", |
6837 "for (let x = 1; x < 1; x++) {}", | 6839 "for (let x = 1; x < 1; x++) {}", |
6838 "for (let x in {}) {}", | 6840 "for (let x in {}) {}", |
6839 "for (let x of []) {}", | 6841 "for (let x of []) {}", |
6840 NULL | 6842 NULL |
6841 }; | 6843 }; |
6842 // clang-format on | 6844 // clang-format on |
6843 | 6845 |
6844 static const ParserFlag always_flags[] = {kAllowHarmonySloppy}; | 6846 static const ParserFlag always_flags[] = {kAllowHarmonySloppy, |
| 6847 kAllowHarmonySloppyLet}; |
6845 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, | 6848 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, |
6846 arraysize(always_flags)); | 6849 arraysize(always_flags)); |
6847 } | 6850 } |
OLD | NEW |