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

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

Issue 1949293002: Further expand parsing tests around yield in generator/arrow parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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 6724 matching lines...) Expand 10 before | Expand all | Expand 10 after
6735 {"'use strict'; ((", ")=>{});"}, 6735 {"'use strict'; ((", ")=>{});"},
6736 {NULL, NULL} 6736 {NULL, NULL}
6737 }; 6737 };
6738 6738
6739 const char* generator_context_data[][2] = { 6739 const char* generator_context_data[][2] = {
6740 {"'use strict'; (function *g(", ") { });"}, 6740 {"'use strict'; (function *g(", ") { });"},
6741 {"(function *g(", ") { });"}, 6741 {"(function *g(", ") { });"},
6742 // Arrow function within generator has the same rules. 6742 // Arrow function within generator has the same rules.
6743 {"'use strict'; (function *g() { (", ") => {} });"}, 6743 {"'use strict'; (function *g() { (", ") => {} });"},
6744 {"(function *g() { (", ") => {} });"}, 6744 {"(function *g() { (", ") => {} });"},
6745 // And similarly for arrow functions in the parameter list.
6746 {"'use strict'; (function *g(z = (", ") => {}) { });"},
6747 {"(function *g(z = (", ") => {}) { });"},
6745 {NULL, NULL} 6748 {NULL, NULL}
6746 }; 6749 };
6747 6750
6748 const char* parameter_data[] = { 6751 const char* parameter_data[] = {
6749 "x=yield", 6752 "x=yield",
6750 "x, y=yield", 6753 "x, y=yield",
6751 "{x=yield}", 6754 "{x=yield}",
6752 "[x=yield]", 6755 "[x=yield]",
6753 6756
6754 "x=(yield)", 6757 "x=(yield)",
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
7457 "for (const x = 0 in {});", 7460 "for (const x = 0 in {});",
7458 "for (let x = 0 in {});", 7461 "for (let x = 0 in {});",
7459 NULL 7462 NULL
7460 }; 7463 };
7461 // clang-format on 7464 // clang-format on
7462 7465
7463 static const ParserFlag always_flags[] = {kAllowHarmonyForIn}; 7466 static const ParserFlag always_flags[] = {kAllowHarmonyForIn};
7464 RunParserSyncTest(context_data, error_data, kError, nullptr, 0, always_flags, 7467 RunParserSyncTest(context_data, error_data, kError, nullptr, 0, always_flags,
7465 arraysize(always_flags)); 7468 arraysize(always_flags));
7466 } 7469 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698