Chromium Code Reviews| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 try { | 395 try { |
| 396 for (; ; for_val_part3_throwbody = 1) { | 396 for (; ; for_val_part3_throwbody = 1) { |
| 397 throwex(); | 397 throwex(); |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 catch (e) { | 400 catch (e) { |
| 401 } | 401 } |
| 402 shouldBe("for_val_part3_throwbody","4"); | 402 shouldBe("for_val_part3_throwbody","4"); |
| 403 | 403 |
| 404 // --------------------------------- | 404 // --------------------------------- |
| 405 var forin_test_obj = new Object(); | |
|
Michael Starzinger
2014/03/17 11:50:35
Better adapt the expected output instead of changi
rossberg
2014/03/17 12:00:16
Doesn't work, unfortunately, because the whole fil
| |
| 406 forin_test_obj.a = 1; | |
| 407 forin_test_obj.b = 2; | |
| 408 forin_test_obj.c = 3; | |
| 409 var forin_count = 4; | |
| 410 function forin_lexpr() { | |
| 411 // if (forincount == 1); | |
| 412 // throwex(); | |
| 413 return new Object(); | |
| 414 } | |
| 415 try { | |
| 416 for (throwex() in forin_test_obj) { | |
| 417 forin_count++; | |
| 418 } | |
| 419 } | |
| 420 catch (e) { | |
| 421 } | |
| 422 shouldBe("forin_count","4"); | |
| 423 | |
| 424 // --------------------------------- | |
| 425 var set_inside_with_throw = 4; | 405 var set_inside_with_throw = 4; |
| 426 try { | 406 try { |
| 427 with (throwex()) { | 407 with (throwex()) { |
| 428 set_inside_with_throw = 1; | 408 set_inside_with_throw = 1; |
| 429 } | 409 } |
| 430 } | 410 } |
| 431 catch (e) { | 411 catch (e) { |
| 432 } | 412 } |
| 433 shouldBe("set_inside_with_throw","4"); | 413 shouldBe("set_inside_with_throw","4"); |
| 434 | 414 |
| 435 // --------------------------------- | 415 // --------------------------------- |
| 436 var set_inside_with_cantconverttoobject = 4; | 416 var set_inside_with_cantconverttoobject = 4; |
| 437 try { | 417 try { |
| 438 with (undefined) { | 418 with (undefined) { |
| 439 print("FAIL. This message should not be displayed"); | 419 print("FAIL. This message should not be displayed"); |
| 440 set_inside_with_cantconverttoobject = 1; | 420 set_inside_with_cantconverttoobject = 1; |
| 441 } | 421 } |
| 442 } | 422 } |
| 443 catch (e) { | 423 catch (e) { |
| 444 } | 424 } |
| 445 shouldBe("set_inside_with_cantconverttoobject","4"); | 425 shouldBe("set_inside_with_cantconverttoobject","4"); |
| 446 // ### test case, sw | 426 // ### test case, sw |
| OLD | NEW |