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

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

Issue 16739008: For-of statements do not permit initializers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/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 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 assertThrows("function f() { for (let x of y z) { } }", SyntaxError); 47 assertThrows("function f() { for (let x of y z) { } }", SyntaxError);
48 assertThrows("function f() { for (let x of y;) { } }", SyntaxError); 48 assertThrows("function f() { for (let x of y;) { } }", SyntaxError);
49 49
50 assertThrows("function f() { for (of y) { } }", SyntaxError); 50 assertThrows("function f() { for (of y) { } }", SyntaxError);
51 assertThrows("function f() { for (of of) { } }", SyntaxError); 51 assertThrows("function f() { for (of of) { } }", SyntaxError);
52 assertThrows("function f() { for (var of y) { } }", SyntaxError); 52 assertThrows("function f() { for (var of y) { } }", SyntaxError);
53 assertThrows("function f() { for (var of of) { } }", SyntaxError); 53 assertThrows("function f() { for (var of of) { } }", SyntaxError);
54 assertThrows("function f() { for (let of y) { } }", SyntaxError); 54 assertThrows("function f() { for (let of y) { } }", SyntaxError);
55 assertThrows("function f() { for (let of of) { } }", SyntaxError); 55 assertThrows("function f() { for (let of of) { } }", SyntaxError);
56 56
57 assertThrows("function f() { for (x = 3 of y) { } }", SyntaxError);
58 assertThrows("function f() { for (var x = 3 of y) { } }", SyntaxError);
59 assertThrows("function f() { for (let x = 3 of y) { } }", SyntaxError);
60
61
57 // Alack, this appears to be valid. 62 // Alack, this appears to be valid.
58 function f() { for (of of y) { } } 63 function f() { for (of of y) { } }
59 function f() { for (let of of y) { } } 64 function f() { for (let of of y) { } }
60 function f() { for (var of of y) { } } 65 function f() { for (var of of y) { } }
61 66
62 // This too, of course. 67 // This too, of course.
63 function f() { for (of in y) { } } 68 function f() { for (of in y) { } }
64 function f() { for (var of in y) { } } 69 function f() { for (var of in y) { } }
65 function f() { for (let of in y) { } } 70 function f() { for (let of in y) { } }
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698