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

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

Issue 1139773005: [destructuring] More tests for object literal pattern (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More feedback 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 6342 matching lines...) Expand 10 before | Expand all | Expand 10 after
6353 "[a,b,c]", 6353 "[a,b,c]",
6354 "{ x : x, y : y }", 6354 "{ x : x, y : y }",
6355 "[]", 6355 "[]",
6356 "{}", 6356 "{}",
6357 "[{x:x, y:y}, [a,b,c]]", 6357 "[{x:x, y:y}, [a,b,c]]",
6358 "[a,,b]", 6358 "[a,,b]",
6359 "{42 : x}", 6359 "{42 : x}",
6360 "{42e-2 : x}", 6360 "{42e-2 : x}",
6361 "{'hi' : x}", 6361 "{'hi' : x}",
6362 "{var: x}", 6362 "{var: x}",
6363 "{}",
6363 NULL}; 6364 NULL};
6364 // clang-format on 6365 // clang-format on
6365 static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring}; 6366 static const ParserFlag always_flags[] = {kAllowHarmonyDestructuring};
6366 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, 6367 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
6367 arraysize(always_flags)); 6368 arraysize(always_flags));
6368 } 6369 }
6369 6370
6370 6371
6371 TEST(DestructuringNegativeTests) { 6372 TEST(DestructuringNegativeTests) {
6372 i::FLAG_harmony_destructuring = true; 6373 i::FLAG_harmony_destructuring = true;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
6456 const char* data[] = { 6457 const char* data[] = {
6457 "yield", 6458 "yield",
6458 "[yield]", 6459 "[yield]",
6459 "{ x : yield }", 6460 "{ x : yield }",
6460 NULL}; 6461 NULL};
6461 // clang-format on 6462 // clang-format on
6462 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 6463 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
6463 arraysize(always_flags)); 6464 arraysize(always_flags));
6464 } 6465 }
6465 } 6466 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698