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 7698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7709 "var f = async(...[await]) => 1;", | 7709 "var f = async(...[await]) => 1;", |
7710 NULL | 7710 NULL |
7711 }; | 7711 }; |
7712 // clang-format on | 7712 // clang-format on |
7713 | 7713 |
7714 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait}; | 7714 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait}; |
7715 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags, | 7715 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags, |
7716 arraysize(always_flags)); | 7716 arraysize(always_flags)); |
7717 RunParserSyncTest(strict_context_data, strict_error_data, kError, NULL, 0, | 7717 RunParserSyncTest(strict_context_data, strict_error_data, kError, NULL, 0, |
7718 always_flags, arraysize(always_flags)); | 7718 always_flags, arraysize(always_flags)); |
7719 { | 7719 |
7720 // TODO(caitp): support these early errors in preparser | 7720 RunParserSyncTest(context_data, formal_parameters_data, kError, NULL, 0, |
7721 USE(formal_parameters_data); | 7721 always_flags, arraysize(always_flags)); |
7722 // const bool kIsModule = false; | |
7723 // const bool kTestPreparser = false; | |
7724 // TODO(caitp): These tests seem to fail test-parsing.cc, even with | |
7725 // test_preparser disabled. | |
7726 // RunParserSyncTest(context_data, formal_parameters_data, kError, NULL, 0, | |
7727 // always_flags, arraysize(always_flags), NULL, 0, | |
7728 // kIsModule, kTestPreparser); | |
7729 } | |
7730 } | 7722 } |
7731 | 7723 |
7732 TEST(AsyncAwaitModule) { | 7724 TEST(AsyncAwaitModule) { |
7733 // clang-format off | 7725 // clang-format off |
7734 const char* context_data[][2] = { | 7726 const char* context_data[][2] = { |
7735 { "", "" }, | 7727 { "", "" }, |
7736 { NULL, NULL } | 7728 { NULL, NULL } |
7737 }; | 7729 }; |
7738 | 7730 |
7739 const char* data[] = { | 7731 const char* data[] = { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7841 NULL}; | 7833 NULL}; |
7842 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait}; | 7834 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait}; |
7843 // The preparser doesn't enforce the restriction, so turn it off. | 7835 // The preparser doesn't enforce the restriction, so turn it off. |
7844 bool test_preparser = false; | 7836 bool test_preparser = false; |
7845 RunParserSyncTest(block_context_data, error_data, kError, NULL, 0, | 7837 RunParserSyncTest(block_context_data, error_data, kError, NULL, 0, |
7846 always_flags, arraysize(always_flags), NULL, 0, false, | 7838 always_flags, arraysize(always_flags), NULL, 0, false, |
7847 test_preparser); | 7839 test_preparser); |
7848 RunParserSyncTest(top_level_context_data, error_data, kSuccess, NULL, 0, | 7840 RunParserSyncTest(top_level_context_data, error_data, kSuccess, NULL, 0, |
7849 always_flags, arraysize(always_flags)); | 7841 always_flags, arraysize(always_flags)); |
7850 } | 7842 } |
OLD | NEW |