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

Side by Side Diff: test/mjsunit/es6/iteration-syntax.js

Issue 1602823003: [parser] Disallow Expression in for..of statements (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 StrictSyntaxError("function f() { for (of of) { } }"); 59 StrictSyntaxError("function f() { for (of of) { } }");
60 StrictSyntaxError("function f() { for (var of y) { } }"); 60 StrictSyntaxError("function f() { for (var of y) { } }");
61 StrictSyntaxError("function f() { for (var of of) { } }"); 61 StrictSyntaxError("function f() { for (var of of) { } }");
62 StrictSyntaxError("function f() { for (let of y) { } }"); 62 StrictSyntaxError("function f() { for (let of y) { } }");
63 StrictSyntaxError("function f() { for (let of of) { } }"); 63 StrictSyntaxError("function f() { for (let of of) { } }");
64 64
65 StrictSyntaxError("function f() { for (x = 3 of y) { } }"); 65 StrictSyntaxError("function f() { for (x = 3 of y) { } }");
66 StrictSyntaxError("function f() { for (var x = 3 of y) { } }"); 66 StrictSyntaxError("function f() { for (var x = 3 of y) { } }");
67 StrictSyntaxError("function f() { for (let x = 3 of y) { } }"); 67 StrictSyntaxError("function f() { for (let x = 3 of y) { } }");
68 68
69 StrictSyntaxError("function f() { for (x of y, z) { } }");
adamk 2016/01/19 22:21:47 Rather than adding tests here (which limits you no
70 StrictSyntaxError("function f() { for (var x of y, z) { } }");
71 StrictSyntaxError("function f() { for (let x of y, z) { } }");
69 72
70 // Alack, this appears to be valid. 73 // Alack, this appears to be valid.
71 function f() { for (of of y) { } } 74 function f() { for (of of y) { } }
72 function f() { for (let of of y) { } } 75 function f() { for (let of of y) { } }
73 function f() { for (var of of y) { } } 76 function f() { for (var of of y) { } }
74 77
75 // This too, of course. 78 // This too, of course.
76 function f() { for (of in y) { } } 79 function f() { for (of in y) { } }
77 function f() { for (var of in y) { } } 80 function f() { for (var of in y) { } }
78 function f() { for (let of in y) { } } 81 function f() { for (let of in y) { } }
OLDNEW
« src/parsing/parser.cc ('K') | « src/parsing/preparser.cc ('k') | test/mjsunit/for-in.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698