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

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

Issue 1570793002: [parser] parenthesized Literals are not valid AssignmentPatterns (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO + move ParenthesizedField line above Type-dependent fields/comments Created 4 years, 11 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 | « src/parsing/preparser.cc ('k') | 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 7024 matching lines...) Expand 10 before | Expand all | Expand 10 after
7035 "{ x: (foo()) }", 7035 "{ x: (foo()) }",
7036 "{ x: (function() {}) }", 7036 "{ x: (function() {}) }",
7037 "{ x: y } = 'str'", 7037 "{ x: y } = 'str'",
7038 "[x, y] = 'str'", 7038 "[x, y] = 'str'",
7039 "[(x,y) => z]", 7039 "[(x,y) => z]",
7040 "{x: (y) => z}", 7040 "{x: (y) => z}",
7041 "[x, ...y, z]", 7041 "[x, ...y, z]",
7042 "[...x,]", 7042 "[...x,]",
7043 "[x, y, ...z = 1]", 7043 "[x, y, ...z = 1]",
7044 "[...z = 1]", 7044 "[...z = 1]",
7045
7046 // v8:4657
7047 "({ x: x4, x: (x+=1e4) })",
7048 "(({ x: x4, x: (x+=1e4) }))",
7049 "({ x: x4, x: (x+=1e4) } = {})",
7050 "(({ x: x4, x: (x+=1e4) } = {}))",
7051 "(({ x: x4, x: (x+=1e4) }) = {})",
7052 "({ x: y } = {})",
7053 "(({ x: y } = {}))",
7054 "(({ x: y }) = {})",
7055 "([a])",
7056 "(([a]))",
7057 "([a] = [])",
7058 "(([a] = []))",
7059 "(([a]) = [])",
7045 NULL}; 7060 NULL};
7046 // clang-format on 7061 // clang-format on
7047 static const ParserFlag always_flags[] = { 7062 static const ParserFlag always_flags[] = {
7048 kAllowHarmonyDestructuringAssignment, kAllowHarmonyDestructuring, 7063 kAllowHarmonyDestructuringAssignment, kAllowHarmonyDestructuring,
7049 kAllowHarmonyDefaultParameters}; 7064 kAllowHarmonyDefaultParameters};
7050 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 7065 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
7051 arraysize(always_flags)); 7066 arraysize(always_flags));
7052 7067
7053 const char* empty_context_data[][2] = { 7068 const char* empty_context_data[][2] = {
7054 {"'use strict';", ""}, {"", ""}, {NULL, NULL}}; 7069 {"'use strict';", ""}, {"", ""}, {NULL, NULL}};
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
7772 } 7787 }
7773 7788
7774 7789
7775 TEST(MiscSyntaxErrors) { 7790 TEST(MiscSyntaxErrors) {
7776 const char* context_data[][2] = { 7791 const char* context_data[][2] = {
7777 {"'use strict'", ""}, {"", ""}, {NULL, NULL}}; 7792 {"'use strict'", ""}, {"", ""}, {NULL, NULL}};
7778 const char* error_data[] = {"for (();;) {}", NULL}; 7793 const char* error_data[] = {"for (();;) {}", NULL};
7779 7794
7780 RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); 7795 RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0);
7781 } 7796 }
OLDNEW
« no previous file with comments | « src/parsing/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698