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

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
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 7775 matching lines...) Expand 10 before | Expand all | Expand 10 after
7786 "async function* f() {}", 7786 "async function* f() {}",
7787 "var O = { *async method() {} };", 7787 "var O = { *async method() {} };",
7788 "var O = { async *method() {} };", 7788 "var O = { async *method() {} };",
7789 "var O = { async method*() {} };", 7789 "var O = { async method*() {} };",
7790 7790
7791 "var asyncFn = async function(x = await 1) { return x; }", 7791 "var asyncFn = async function(x = await 1) { return x; }",
7792 "async function f(x = await 1) { return x; }", 7792 "async function f(x = await 1) { return x; }",
7793 "var f = async(x = await 1) => x;", 7793 "var f = async(x = await 1) => x;",
7794 "var O = { async method(x = await 1) { return x; } };", 7794 "var O = { async method(x = await 1) { return x; } };",
7795 7795
7796 "var f = async(x = await) => 1;",
7797
7798 "function* g() { var f = async yield => 1; }", 7796 "function* g() { var f = async yield => 1; }",
7799 "function* g() { var f = async(yield) => 1; }", 7797 "function* g() { var f = async(yield) => 1; }",
7800 "function* g() { var f = async(x = yield) => 1; }", 7798 "function* g() { var f = async(x = yield) => 1; }",
7801 "function* g() { var f = async({x = yield}) => 1; }", 7799 "function* g() { var f = async({x = yield}) => 1; }",
7802 7800
7803 "class C { async constructor() {} }", 7801 "class C { async constructor() {} }",
7804 "class C {}; class C2 extends C { async constructor() {} }", 7802 "class C {}; class C2 extends C { async constructor() {} }",
7805 "class C { static async prototype() {} }", 7803 "class C { static async prototype() {} }",
7806 "class C {}; class C2 extends C { static async prototype() {} }", 7804 "class C {}; class C2 extends C { static async prototype() {} }",
7807 7805
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
7864 "var f = async({ await } = {}) => 1;", 7862 "var f = async({ await } = {}) => 1;",
7865 "var f = async({ await = 1 } = {}) => 1;", 7863 "var f = async({ await = 1 } = {}) => 1;",
7866 "var f = async([await]) => 1;", 7864 "var f = async([await]) => 1;",
7867 "var f = async([await] = []) => 1;", 7865 "var f = async([await] = []) => 1;",
7868 "var f = async([await = 1]) => 1;", 7866 "var f = async([await = 1]) => 1;",
7869 "var f = async([await = 1] = []) => 1;", 7867 "var f = async([await = 1] = []) => 1;",
7870 "var f = async(...await) => 1;", 7868 "var f = async(...await) => 1;",
7871 "var f = async(await) => 1;", 7869 "var f = async(await) => 1;",
7872 "var f = async(await = 1) => 1;", 7870 "var f = async(await = 1) => 1;",
7873 "var f = async(...[await]) => 1;", 7871 "var f = async(...[await]) => 1;",
7872 "var f = async(x = await) => 1;",
7874 7873
7875 // v8:5190 7874 // v8:5190
7876 "var f = async(1) => 1", 7875 "var f = async(1) => 1",
7877 "var f = async('str') => 1", 7876 "var f = async('str') => 1",
7878 "var f = async(/foo/) => 1", 7877 "var f = async(/foo/) => 1",
7879 "var f = async({ foo = async(1) => 1 }) => 1", 7878 "var f = async({ foo = async(1) => 1 }) => 1",
7880 "var f = async({ foo = async(a) => 1 })", 7879 "var f = async({ foo = async(a) => 1 })",
7881 7880
7881 "var f = async(x = async(await)) => 1;",
7882 "var f = async(x = { [await]: 1 }) => 1;",
7883 "var f = async(x = class extends (await) { }) => 1;",
7884 "var f = async(x = class { static [await]() {} }) => 1;",
7885 "var f = async({ x = await }) => 1;",
7886
7882 NULL 7887 NULL
7883 }; 7888 };
7884 // clang-format on 7889 // clang-format on
7885 7890
7886 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait}; 7891 static const ParserFlag always_flags[] = {kAllowHarmonyAsyncAwait};
7887 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags, 7892 RunParserSyncTest(context_data, error_data, kError, NULL, 0, always_flags,
7888 arraysize(always_flags)); 7893 arraysize(always_flags));
7889 RunParserSyncTest(strict_context_data, strict_error_data, kError, NULL, 0, 7894 RunParserSyncTest(strict_context_data, strict_error_data, kError, NULL, 0,
7890 always_flags, arraysize(always_flags)); 7895 always_flags, arraysize(always_flags));
7891 7896
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
8151 "(a,);", 8156 "(a,);",
8152 "(a,b,c,);", 8157 "(a,b,c,);",
8153 NULL 8158 NULL
8154 }; 8159 };
8155 // clang-format on 8160 // clang-format on
8156 8161
8157 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; 8162 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas};
8158 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 8163 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
8159 arraysize(always_flags)); 8164 arraysize(always_flags));
8160 } 8165 }
OLDNEW
« src/parsing/expression-classifier.h ('K') | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698