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

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

Issue 1151503002: [destructuring] Implement spread binding patterns. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments addressed 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 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 6377 matching lines...) Expand 10 before | Expand all | Expand 10 after
6388 "{42e-2 : x}", 6388 "{42e-2 : x}",
6389 "{42e-2 : x = 42}", 6389 "{42e-2 : x = 42}",
6390 "{'hi' : x}", 6390 "{'hi' : x}",
6391 "{'hi' : x = 42}", 6391 "{'hi' : x = 42}",
6392 "{var: x}", 6392 "{var: x}",
6393 "{var: x = 42}", 6393 "{var: x = 42}",
6394 "{[x] : z}", 6394 "{[x] : z}",
6395 "{[1+1] : z}", 6395 "{[1+1] : z}",
6396 "{[foo()] : z}", 6396 "{[foo()] : z}",
6397 "{}", 6397 "{}",
6398 "[...rest]",
6399 "[a,b,...rest]",
6400 "[a,,...rest]",
6398 NULL}; 6401 NULL};
6399 // clang-format on 6402 // clang-format on
6400 static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals, 6403 static const ParserFlag always_flags[] = {kAllowHarmonyObjectLiterals,
6401 kAllowHarmonyComputedPropertyNames, 6404 kAllowHarmonyComputedPropertyNames,
6402 kAllowHarmonyDestructuring}; 6405 kAllowHarmonyDestructuring};
6403 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, 6406 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
6404 arraysize(always_flags)); 6407 arraysize(always_flags));
6405 } 6408 }
6406 6409
6407 6410
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
6460 "{+2 : x}", 6463 "{+2 : x}",
6461 "{-2 : x}", 6464 "{-2 : x}",
6462 "var", 6465 "var",
6463 "[var]", 6466 "[var]",
6464 "{x : {y : var}}", 6467 "{x : {y : var}}",
6465 "{x : x = a+}", 6468 "{x : x = a+}",
6466 "{x : x = (a+)}", 6469 "{x : x = (a+)}",
6467 "{x : x += a}", 6470 "{x : x += a}",
6468 "{m() {} = 0}", 6471 "{m() {} = 0}",
6469 "{[1+1]}", 6472 "{[1+1]}",
6473 "[...rest, x]",
6474 "[a,b,...rest, x]",
6475 "[a,,...rest, x]",
6476 "[...rest,]",
6477 "[a,b,...rest,]",
6478 "[a,,...rest,]",
6479 "[...rest,...rest1]",
6480 "[a,b,...rest,...rest1]",
6481 "[a,,..rest,...rest1]",
6470 NULL}; 6482 NULL};
6471 // clang-format on 6483 // clang-format on
6472 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 6484 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
6473 arraysize(always_flags)); 6485 arraysize(always_flags));
6474 } 6486 }
6475 6487
6476 { // Strict mode. 6488 { // Strict mode.
6477 const char* context_data[][2] = {{"'use strict'; let ", " = {};"}, 6489 const char* context_data[][2] = {{"'use strict'; let ", " = {};"},
6478 {"'use strict'; const ", " = {};"}, 6490 {"'use strict'; const ", " = {};"},
6479 {NULL, NULL}}; 6491 {NULL, NULL}};
(...skipping 21 matching lines...) Expand all
6501 const char* data[] = { 6513 const char* data[] = {
6502 "yield", 6514 "yield",
6503 "[yield]", 6515 "[yield]",
6504 "{ x : yield }", 6516 "{ x : yield }",
6505 NULL}; 6517 NULL};
6506 // clang-format on 6518 // clang-format on
6507 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 6519 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
6508 arraysize(always_flags)); 6520 arraysize(always_flags));
6509 } 6521 }
6510 } 6522 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698