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 7822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7833 "class C {}; class C2 extends C { static async prototype() {} }", | 7833 "class C {}; class C2 extends C { static async prototype() {} }", |
7834 | 7834 |
7835 "var f = async() => ((async(x = await 1) => x)();", | 7835 "var f = async() => ((async(x = await 1) => x)();", |
7836 | 7836 |
7837 "var asyncFn = async function() { function await() {} }", | 7837 "var asyncFn = async function() { function await() {} }", |
7838 "var asyncFn = async() => { function await() {} }", | 7838 "var asyncFn = async() => { function await() {} }", |
7839 "var O = { async method() { function await() {} } }", | 7839 "var O = { async method() { function await() {} } }", |
7840 "async function foo() { function await() {} }", | 7840 "async function foo() { function await() {} }", |
7841 | 7841 |
7842 // Henrique Ferreiro's bug (tm) | 7842 // Henrique Ferreiro's bug (tm) |
7843 "(async function foo() { } foo => 1)", | 7843 "(async function foo1() { } foo2 => 1)", |
7844 "(async function foo() { } () => 1)", | 7844 "(async function foo3() { } () => 1)", |
7845 "(async function foo() { } => 1)", | 7845 "(async function foo4() { } => 1)", |
7846 "(async function() { } foo => 1)", | 7846 "(async function() { } foo5 => 1)", |
7847 "(async function() { } () => 1)", | 7847 "(async function() { } () => 1)", |
7848 "(async function() { } => 1)", | 7848 "(async function() { } => 1)", |
7849 "(async.foo => 1)", | 7849 "(async.foo6 => 1)", |
7850 "(async.foo foo => 1)", | 7850 "(async.foo7 foo8 => 1)", |
7851 "(async.foo () => 1)", | 7851 "(async.foo9 () => 1)", |
7852 "(async().foo => 1)", | 7852 "(async().foo10 => 1)", |
7853 "(async().foo foo => 1)", | 7853 "(async().foo11 foo12 => 1)", |
7854 "(async().foo () => 1)", | 7854 "(async().foo13 () => 1)", |
7855 "(async['foo'] => 1)", | 7855 "(async['foo14'] => 1)", |
7856 "(async['foo'] foo => 1)", | 7856 "(async['foo15'] foo16 => 1)", |
7857 "(async['foo'] () => 1)", | 7857 "(async['foo17'] () => 1)", |
7858 "(async()['foo'] => 1)", | 7858 "(async()['foo18'] => 1)", |
7859 "(async()['foo'] foo => 1)", | 7859 "(async()['foo19'] foo20 => 1)", |
7860 "(async()['foo'] () => 1)", | 7860 "(async()['foo21'] () => 1)", |
7861 "(async`foo` => 1)", | 7861 "(async`foo22` => 1)", |
7862 "(async`foo` foo => 1)", | 7862 "(async`foo23` foo24 => 1)", |
7863 "(async`foo` () => 1)", | 7863 "(async`foo25` () => 1)", |
7864 "(async`foo`.bar => 1)", | 7864 "(async`foo26`.bar27 => 1)", |
7865 "(async`foo`.bar foo => 1)", | 7865 "(async`foo28`.bar29 foo30 => 1)", |
7866 "(async`foo`.bar () => 1)", | 7866 "(async`foo31`.bar32 () => 1)", |
7867 | 7867 |
7868 // v8:5148 assert that errors are still thrown for calls that may have been | 7868 // v8:5148 assert that errors are still thrown for calls that may have been |
7869 // async functions | 7869 // async functions |
7870 "async({ foo = 1 })", | 7870 "async({ foo33 = 1 })", |
7871 NULL | 7871 NULL |
7872 }; | 7872 }; |
7873 | 7873 |
7874 const char* strict_error_data[] = { | 7874 const char* strict_error_data[] = { |
7875 "var O = { async method(eval) {} }", | 7875 "var O = { async method(eval) {} }", |
7876 "var O = { async ['meth' + 'od'](eval) {} }", | 7876 "var O = { async ['meth' + 'od'](eval) {} }", |
7877 "var O = { async 'method'(eval) {} }", | 7877 "var O = { async 'method'(eval) {} }", |
7878 "var O = { async 0(eval) {} }", | 7878 "var O = { async 0(eval) {} }", |
7879 | 7879 |
7880 "var O = { async method(arguments) {} }", | 7880 "var O = { async method(arguments) {} }", |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8141 "(a,);", | 8141 "(a,);", |
8142 "(a,b,c,);", | 8142 "(a,b,c,);", |
8143 NULL | 8143 NULL |
8144 }; | 8144 }; |
8145 // clang-format on | 8145 // clang-format on |
8146 | 8146 |
8147 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; | 8147 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; |
8148 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, | 8148 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
8149 arraysize(always_flags)); | 8149 arraysize(always_flags)); |
8150 } | 8150 } |
OLD | NEW |