Chromium Code Reviews| Index: test/mjsunit/strict-mode.js |
| diff --git a/test/mjsunit/strict-mode.js b/test/mjsunit/strict-mode.js |
| index ddddfabee42f91c943b1e588d292bc434ae0cfcb..afe761e6c9ca1939b2db9da8c805e369943ebd53 100644 |
| --- a/test/mjsunit/strict-mode.js |
| +++ b/test/mjsunit/strict-mode.js |
| @@ -335,4 +335,30 @@ for (var i = 0; i < future_reserved_words.length; i++) { |
| testFutureReservedWord(future_reserved_words[i]); |
| } |
| +function testAssignToUndefined(should_throw) { |
| + "use strict"; |
| + try { |
| + possibly_undefined_variable_for_strict_mode_test = "should throw?"; |
| + } catch (e) { |
| + assertTrue(should_throw, "strict mode"); |
| + assertInstanceof(e, ReferenceError, "strict mode"); |
| + return; |
| + } |
| + assertFalse(should_throw, "strict mode"); |
| +} |
| + |
| +testAssignToUndefined(true); |
| +testAssignToUndefined(true); |
| +testAssignToUndefined(true); |
|
MarkM
2011/02/11 03:06:59
Why are you calling this three times for each case
Mads Ager (chromium)
2011/02/11 08:08:09
In order to make sure that ICs are initialized and
Martin Maly
2011/02/11 21:43:28
Done.
|
| + |
| +possibly_undefined_variable_for_strict_mode_test = "value"; |
| + |
| +testAssignToUndefined(false); |
| +testAssignToUndefined(false); |
| +testAssignToUndefined(false); |
| + |
| +delete possibly_undefined_variable_for_strict_mode_test; |
| +testAssignToUndefined(true); |
| +testAssignToUndefined(true); |
| +testAssignToUndefined(true); |