OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 function testAssignmentArgument(x) { | 61 function testAssignmentArgument(x) { |
62 function local() { | 62 function local() { |
63 var source = "delete x; const x = 7; assertEquals(7, x)"; | 63 var source = "delete x; const x = 7; assertEquals(7, x)"; |
64 eval(source); | 64 eval(source); |
65 } | 65 } |
66 local(); | 66 local(); |
67 assertEquals(7, x); | 67 assertEquals(7, x); |
68 } | 68 } |
69 | 69 |
70 testAssignmentArgument(); | 70 for (var i = 0; i < 10000; i++) { |
| 71 testAssignmentArgument(); |
| 72 } |
71 assertEquals(6, x); | 73 assertEquals(6, x); |
72 | 74 |
73 __defineSetter__('x', function() { throw 42; }); | 75 __defineSetter__('x', function() { throw 42; }); |
74 function testAssignGlobalThrows() { | 76 function testAssignGlobalThrows() { |
75 // Initialization turns into assignment to global 'x' which | 77 // Initialization turns into assignment to global 'x' which |
76 // throws an exception. | 78 // throws an exception. |
77 var source = "delete x; const x = 8"; | 79 var source = "delete x; const x = 8"; |
78 eval(source); | 80 eval(source); |
79 } | 81 } |
80 | 82 |
(...skipping 21 matching lines...) Expand all Loading... |
102 var x = 12; | 104 var x = 12; |
103 function local() { | 105 function local() { |
104 var source = "delete x; const x = 13; assertEquals(13, x)"; | 106 var source = "delete x; const x = 13; assertEquals(13, x)"; |
105 eval(source); | 107 eval(source); |
106 } | 108 } |
107 local(); | 109 local(); |
108 assertEquals(13, x); | 110 assertEquals(13, x); |
109 } | 111 } |
110 | 112 |
111 testAssignSurroundingContextSlot(); | 113 testAssignSurroundingContextSlot(); |
OLD | NEW |