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

Unified Diff: test/cctest/test-parsing.cc

Issue 1129083009: [destructuring] Support computed property names in patterns. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch for landing Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 2ad657ef3c69eb665360db125f64deaa937082db..5ccd67341666f41dee52964b8b7488238cabf9e5 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -6357,6 +6357,7 @@ TEST(StrongModeFreeVariablesNotDeclared) {
TEST(DestructuringPositiveTests) {
i::FLAG_harmony_destructuring = true;
+ i::FLAG_harmony_computed_property_names = true;
const char* context_data[][2] = {{"'use strict'; let ", " = {};"},
{"var ", " = {};"},
@@ -6391,10 +6392,14 @@ TEST(DestructuringPositiveTests) {
"{'hi' : x = 42}",
"{var: x}",
"{var: x = 42}",
+ "{[x] : z}",
+ "{[1+1] : z}",
+ "{[foo()] : z}",
"{}",
NULL};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals,
+ kAllowHarmonyComputedPropertyNames,
kAllowHarmonyDestructuring};
RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
arraysize(always_flags));
@@ -6403,7 +6408,9 @@ TEST(DestructuringPositiveTests) {
TEST(DestructuringNegativeTests) {
i::FLAG_harmony_destructuring = true;
+ i::FLAG_harmony_computed_property_names = true;
static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals,
+ kAllowHarmonyComputedPropertyNames,
kAllowHarmonyDestructuring};
{ // All modes.
@@ -6460,6 +6467,7 @@ TEST(DestructuringNegativeTests) {
"{x : x = (a+)}",
"{x : x += a}",
"{m() {} = 0}",
+ "{[1+1]}",
NULL};
// clang-format on
RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
« no previous file with comments | « src/preparser.h ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698