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 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 parser->set_allow_lazy(flags.Contains(kAllowLazy)); | 1517 parser->set_allow_lazy(flags.Contains(kAllowLazy)); |
1518 parser->set_allow_natives(flags.Contains(kAllowNatives)); | 1518 parser->set_allow_natives(flags.Contains(kAllowNatives)); |
1519 parser->set_allow_harmony_default_parameters( | 1519 parser->set_allow_harmony_default_parameters( |
1520 flags.Contains(kAllowHarmonyDefaultParameters)); | 1520 flags.Contains(kAllowHarmonyDefaultParameters)); |
1521 parser->set_allow_harmony_rest_parameters( | 1521 parser->set_allow_harmony_rest_parameters( |
1522 flags.Contains(kAllowHarmonyRestParameters)); | 1522 flags.Contains(kAllowHarmonyRestParameters)); |
1523 parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy)); | 1523 parser->set_allow_harmony_sloppy(flags.Contains(kAllowHarmonySloppy)); |
1524 parser->set_allow_harmony_sloppy_let(flags.Contains(kAllowHarmonySloppyLet)); | 1524 parser->set_allow_harmony_sloppy_let(flags.Contains(kAllowHarmonySloppyLet)); |
1525 parser->set_allow_harmony_destructuring( | 1525 parser->set_allow_harmony_destructuring( |
1526 flags.Contains(kAllowHarmonyDestructuring)); | 1526 flags.Contains(kAllowHarmonyDestructuring)); |
1527 parser->set_allow_harmony_new_target(flags.Contains(kAllowHarmonyNewTarget)); | |
1528 parser->set_allow_strong_mode(flags.Contains(kAllowStrongMode)); | 1527 parser->set_allow_strong_mode(flags.Contains(kAllowStrongMode)); |
1529 parser->set_allow_legacy_const(!flags.Contains(kNoLegacyConst)); | 1528 parser->set_allow_legacy_const(!flags.Contains(kNoLegacyConst)); |
1530 } | 1529 } |
1531 | 1530 |
1532 | 1531 |
1533 void TestParserSyncWithFlags(i::Handle<i::String> source, | 1532 void TestParserSyncWithFlags(i::Handle<i::String> source, |
1534 i::EnumSet<ParserFlag> flags, | 1533 i::EnumSet<ParserFlag> flags, |
1535 ParserSyncTestResult result) { | 1534 ParserSyncTestResult result) { |
1536 i::Isolate* isolate = CcTest::i_isolate(); | 1535 i::Isolate* isolate = CcTest::i_isolate(); |
1537 i::Factory* factory = isolate->factory(); | 1536 i::Factory* factory = isolate->factory(); |
(...skipping 5690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7228 NULL | 7227 NULL |
7229 }; | 7228 }; |
7230 // clang-format on | 7229 // clang-format on |
7231 | 7230 |
7232 static const ParserFlag fail_flags[] = { | 7231 static const ParserFlag fail_flags[] = { |
7233 kAllowHarmonySloppy, kAllowHarmonySloppyLet, kNoLegacyConst, | 7232 kAllowHarmonySloppy, kAllowHarmonySloppyLet, kNoLegacyConst, |
7234 kAllowHarmonyDestructuring}; | 7233 kAllowHarmonyDestructuring}; |
7235 RunParserSyncTest(context_data, fail_data, kError, NULL, 0, fail_flags, | 7234 RunParserSyncTest(context_data, fail_data, kError, NULL, 0, fail_flags, |
7236 arraysize(fail_flags)); | 7235 arraysize(fail_flags)); |
7237 } | 7236 } |
OLD | NEW |