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

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

Issue 2271063002: Centralize and standardize logic for ExpressionClassifier accumulation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 4 years, 3 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
« no previous file with comments | « src/parsing/preparser.cc ('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 7799 matching lines...) Expand 10 before | Expand all | Expand 10 after
7810 "async function* f() {}", 7810 "async function* f() {}",
7811 "var O = { *async method() {} };", 7811 "var O = { *async method() {} };",
7812 "var O = { async *method() {} };", 7812 "var O = { async *method() {} };",
7813 "var O = { async method*() {} };", 7813 "var O = { async method*() {} };",
7814 7814
7815 "var asyncFn = async function(x = await 1) { return x; }", 7815 "var asyncFn = async function(x = await 1) { return x; }",
7816 "async function f(x = await 1) { return x; }", 7816 "async function f(x = await 1) { return x; }",
7817 "var f = async(x = await 1) => x;", 7817 "var f = async(x = await 1) => x;",
7818 "var O = { async method(x = await 1) { return x; } };", 7818 "var O = { async method(x = await 1) { return x; } };",
7819 7819
7820 "var f = async(x = await) => 1;",
7821
7822 "function* g() { var f = async yield => 1; }", 7820 "function* g() { var f = async yield => 1; }",
7823 "function* g() { var f = async(yield) => 1; }", 7821 "function* g() { var f = async(yield) => 1; }",
7824 "function* g() { var f = async(x = yield) => 1; }", 7822 "function* g() { var f = async(x = yield) => 1; }",
7825 "function* g() { var f = async({x = yield}) => 1; }", 7823 "function* g() { var f = async({x = yield}) => 1; }",
7826 7824
7827 "class C { async constructor() {} }", 7825 "class C { async constructor() {} }",
7828 "class C {}; class C2 extends C { async constructor() {} }", 7826 "class C {}; class C2 extends C { async constructor() {} }",
7829 "class C { static async prototype() {} }", 7827 "class C { static async prototype() {} }",
7830 "class C {}; class C2 extends C { static async prototype() {} }", 7828 "class C {}; class C2 extends C { static async prototype() {} }",
7831 7829
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
7888 "var f = async({ await } = {}) => 1;", 7886 "var f = async({ await } = {}) => 1;",
7889 "var f = async({ await = 1 } = {}) => 1;", 7887 "var f = async({ await = 1 } = {}) => 1;",
7890 "var f = async([await]) => 1;", 7888 "var f = async([await]) => 1;",
7891 "var f = async([await] = []) => 1;", 7889 "var f = async([await] = []) => 1;",
7892 "var f = async([await = 1]) => 1;", 7890 "var f = async([await = 1]) => 1;",
7893 "var f = async([await = 1] = []) => 1;", 7891 "var f = async([await = 1] = []) => 1;",
7894 "var f = async(...await) => 1;", 7892 "var f = async(...await) => 1;",
7895 "var f = async(await) => 1;", 7893 "var f = async(await) => 1;",
7896 "var f = async(await = 1) => 1;", 7894 "var f = async(await = 1) => 1;",
7897 "var f = async(...[await]) => 1;", 7895 "var f = async(...[await]) => 1;",
7896 "var f = async(x = await) => 1;",
7898 7897
7899 // v8:5190 7898 // v8:5190
7900 "var f = async(1) => 1", 7899 "var f = async(1) => 1",
7901 "var f = async('str') => 1", 7900 "var f = async('str') => 1",
7902 "var f = async(/foo/) => 1", 7901 "var f = async(/foo/) => 1",
7903 "var f = async({ foo = async(1) => 1 }) => 1", 7902 "var f = async({ foo = async(1) => 1 }) => 1",
7904 "var f = async({ foo = async(a) => 1 })", 7903 "var f = async({ foo = async(a) => 1 })",
7905 7904
7905 "var f = async(x = async(await)) => 1;",
7906 "var f = async(x = { [await]: 1 }) => 1;",
7907 "var f = async(x = class extends (await) { }) => 1;",
7908 "var f = async(x = class { static [await]() {} }) => 1;",
7909 "var f = async({ x = await }) => 1;",
7910
7906 NULL 7911 NULL
7907 }; 7912 };
7908 // clang-format on 7913 // clang-format on
7909 7914
7910 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait}; 7915 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait};
7911 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags, 7916 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags,
7912 arraysize(always_flags)); 7917 arraysize(always_flags));
7913 RunParserSyncTest(strict_context_data, strict_error_data, kError, NULL, 0, 7918 RunParserSyncTest(strict_context_data, strict_error_data, kError, NULL, 0,
7914 always_flags, arraysize(always_flags)); 7919 always_flags, arraysize(always_flags));
7915 7920
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
8175 "(a,);", 8180 "(a,);",
8176 "(a,b,c,);", 8181 "(a,b,c,);",
8177 NULL 8182 NULL
8178 }; 8183 };
8179 // clang-format on 8184 // clang-format on
8180 8185
8181 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; 8186 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas};
8182 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 8187 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
8183 arraysize(always_flags)); 8188 arraysize(always_flags));
8184 } 8189 }
OLDNEW
« no previous file with comments | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698