Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: test/cctest/test-parsing.cc

Issue 2258313002: [async functions] Disallow 'await' in arrow params inside async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/parsing/parser-base.h ('K') | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7780 matching lines...) Expand 10 before | Expand all | Expand 10 after
7791 const char* body_data[] = { 7791 const char* body_data[] = {
7792 "var async = 1; return async;", 7792 "var async = 1; return async;",
7793 "let async = 1; return async;", 7793 "let async = 1; return async;",
7794 "const async = 1; return async;", 7794 "const async = 1; return async;",
7795 "function async() {} return async();", 7795 "function async() {} return async();",
7796 "var async = async => async; return async();", 7796 "var async = async => async; return async();",
7797 "function foo() { var await = 1; return await; }", 7797 "function foo() { var await = 1; return await; }",
7798 "function foo(await) { return await; }", 7798 "function foo(await) { return await; }",
7799 "function* foo() { var await = 1; return await; }", 7799 "function* foo() { var await = 1; return await; }",
7800 "function* foo(await) { return await; }", 7800 "function* foo(await) { return await; }",
7801 "var f = (await) => await;",
7802 "var f = () => { var await = 1; return await; }", 7801 "var f = () => { var await = 1; return await; }",
7803 "var O = { method() { var await = 1; return await; } };", 7802 "var O = { method() { var await = 1; return await; } };",
7804 "var O = { method(await) { return await; } };", 7803 "var O = { method(await) { return await; } };",
7805 "var O = { *method() { var await = 1; return await; } };", 7804 "var O = { *method() { var await = 1; return await; } };",
7806 "var O = { *method(await) { return await; } };", 7805 "var O = { *method(await) { return await; } };",
7807 7806
7808 "(function await() {})", 7807 "(function await() {})",
7809 NULL 7808 NULL
7810 }; 7809 };
7811 // clang-format on 7810 // clang-format on
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
7878 "class C { static async prototype() {} }", 7877 "class C { static async prototype() {} }",
7879 "class C {}; class C2 extends C { static async prototype() {} }", 7878 "class C {}; class C2 extends C { static async prototype() {} }",
7880 7879
7881 "var f = async() => ((async(x = await 1) => x)();", 7880 "var f = async() => ((async(x = await 1) => x)();",
7882 7881
7883 "var asyncFn = async function() { function await() {} }", 7882 "var asyncFn = async function() { function await() {} }",
7884 "var asyncFn = async() => { function await() {} }", 7883 "var asyncFn = async() => { function await() {} }",
7885 "var O = { async method() { function await() {} } }", 7884 "var O = { async method() { function await() {} } }",
7886 "async function foo() { function await() {} }", 7885 "async function foo() { function await() {} }",
7887 7886
7887 "async function foo() { var f = (await) => await; }",
7888
7888 // Henrique Ferreiro's bug (tm) 7889 // Henrique Ferreiro's bug (tm)
7889 "(async function foo1() { } foo2 => 1)", 7890 "(async function foo1() { } foo2 => 1)",
7890 "(async function foo3() { } () => 1)", 7891 "(async function foo3() { } () => 1)",
7891 "(async function foo4() { } => 1)", 7892 "(async function foo4() { } => 1)",
7892 "(async function() { } foo5 => 1)", 7893 "(async function() { } foo5 => 1)",
7893 "(async function() { } () => 1)", 7894 "(async function() { } () => 1)",
7894 "(async function() { } => 1)", 7895 "(async function() { } => 1)",
7895 "(async.foo6 => 1)", 7896 "(async.foo6 => 1)",
7896 "(async.foo7 foo8 => 1)", 7897 "(async.foo7 foo8 => 1)",
7897 "(async.foo9 () => 1)", 7898 "(async.foo9 () => 1)",
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
8187 "(a,);", 8188 "(a,);",
8188 "(a,b,c,);", 8189 "(a,b,c,);",
8189 NULL 8190 NULL
8190 }; 8191 };
8191 // clang-format on 8192 // clang-format on
8192 8193
8193 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; 8194 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas};
8194 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 8195 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
8195 arraysize(always_flags)); 8196 arraysize(always_flags));
8196 } 8197 }
OLDNEW
« src/parsing/parser-base.h ('K') | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698