OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // 1. Redistributions of source code must retain the above copyright | 7 // 1. Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // 2. Redistributions in binary form must reproduce the above copyright | 9 // 2. Redistributions in binary form must reproduce the above copyright |
10 // notice, this list of conditions and the following disclaimer in the | 10 // notice, this list of conditions and the following disclaimer in the |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 valid ("for (var a, b ; ; ) { break } "); | 284 valid ("for (var a, b ; ; ) { break } "); |
285 valid ("for (var a = b, b = a ; ; ) break"); | 285 valid ("for (var a = b, b = a ; ; ) break"); |
286 valid ("for (var a = b, c, d, b = a ; x in b ; ) { break }"); | 286 valid ("for (var a = b, c, d, b = a ; x in b ; ) { break }"); |
287 valid ("for (var a = b, c, d ; ; 1 in a()) break"); | 287 valid ("for (var a = b, c, d ; ; 1 in a()) break"); |
288 invalid("for ( ; var a ; ) break"); | 288 invalid("for ( ; var a ; ) break"); |
289 invalid("for (const a; ; ) break"); | 289 invalid("for (const a; ; ) break"); |
290 invalid("for ( %a ; ; ) { }"); | 290 invalid("for ( %a ; ; ) { }"); |
291 valid ("for (a in b) break"); | 291 valid ("for (a in b) break"); |
292 valid ("for (a() in b) break"); | 292 valid ("for (a() in b) break"); |
293 valid ("for (a().l[4] in b) break"); | 293 valid ("for (a().l[4] in b) break"); |
294 valid ("for (new a in b in c in d) break"); | 294 invalid("for (new a in b in c in d) break"); |
295 valid ("for (new new new a in b) break"); | 295 invalid("for (new new new a in b) break"); |
296 invalid("for (delete new a() in b) break"); | 296 invalid("for (delete new a() in b) break"); |
297 invalid("for (a * a in b) break"); | 297 invalid("for (a * a in b) break"); |
298 valid ("for ((a * a) in b) break"); | 298 invalid("for ((a * a) in b) break"); |
299 invalid("for (a++ in b) break"); | 299 invalid("for (a++ in b) break"); |
300 valid ("for ((a++) in b) break"); | 300 invalid("for ((a++) in b) break"); |
301 invalid("for (++a in b) break"); | 301 invalid("for (++a in b) break"); |
302 valid ("for ((++a) in b) break"); | 302 invalid("for ((++a) in b) break"); |
303 invalid("for (a, b in c) break"); | 303 invalid("for (a, b in c) break"); |
304 invalid("for (a,b in c ;;) break"); | 304 invalid("for (a,b in c ;;) break"); |
305 valid ("for (a,(b in c) ;;) break"); | 305 valid ("for (a,(b in c) ;;) break"); |
306 valid ("for ((a, b) in c) break"); | 306 invalid("for ((a, b) in c) break"); |
307 invalid("for (a ? b : c in c) break"); | 307 invalid("for (a ? b : c in c) break"); |
308 valid ("for ((a ? b : c) in c) break"); | 308 invalid("for ((a ? b : c) in c) break"); |
309 valid ("for (var a in b in c) break"); | 309 valid ("for (var a in b in c) break"); |
310 valid ("for (var a = 5 += 6 in b) break"); | 310 valid ("for (var a = 5 += 6 in b) break"); |
311 invalid("for (var a += 5 in b) break"); | 311 invalid("for (var a += 5 in b) break"); |
312 invalid("for (var a = in b) break"); | 312 invalid("for (var a = in b) break"); |
313 invalid("for (var a, b in b) break"); | 313 invalid("for (var a, b in b) break"); |
314 invalid("for (var a = -6, b in b) break"); | 314 invalid("for (var a = -6, b in b) break"); |
315 invalid("for (var a, b = 8 in b) break"); | 315 invalid("for (var a, b = 8 in b) break"); |
316 valid ("for (var a = (b in c) in d) break"); | 316 valid ("for (var a = (b in c) in d) break"); |
317 invalid("for (var a = (b in c in d) break"); | 317 invalid("for (var a = (b in c in d) break"); |
318 invalid("for (var (a) in b) { }"); | 318 invalid("for (var (a) in b) { }"); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 try { eval("a.b.c = {};"); } catch(e1) { e=e1; shouldBe("e.line", "1") } | 395 try { eval("a.b.c = {};"); } catch(e1) { e=e1; shouldBe("e.line", "1") } |
396 foo = 'FAIL'; | 396 foo = 'FAIL'; |
397 bar = 'PASS'; | 397 bar = 'PASS'; |
398 try { | 398 try { |
399 eval("foo = 'PASS'; a.b.c = {}; bar = 'FAIL';"); | 399 eval("foo = 'PASS'; a.b.c = {}; bar = 'FAIL';"); |
400 } catch(e) { | 400 } catch(e) { |
401 shouldBe("foo", "'PASS'"); | 401 shouldBe("foo", "'PASS'"); |
402 shouldBe("bar", "'PASS'"); | 402 shouldBe("bar", "'PASS'"); |
403 } | 403 } |
OLD | NEW |