OLD | NEW |
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 Loading... |
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) { } } |
OLD | NEW |