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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 var source = "const x = 9; assertEquals(9, x); x = 10; assertEquals(9, x)"; | 84 var source = "const x = 9; assertEquals(9, x); x = 10; assertEquals(9, x)"; |
85 eval(source); | 85 eval(source); |
86 } | 86 } |
87 | 87 |
88 testInitFastCaseExtension(); | 88 testInitFastCaseExtension(); |
89 | 89 |
90 function testInitSlowCaseExtension() { | 90 function testInitSlowCaseExtension() { |
91 var source = ""; | 91 var source = ""; |
92 // Introduce 100 properties on the context extension object to force | 92 // Introduce 100 properties on the context extension object to force |
93 // it in slow case. | 93 // it in slow case. |
94 for (var i = 0; i < 100; i++) source += ("var a" + i + " = i;"); | 94 for (var i = 0; i < 100; i++) source += ("var a" + i + " = " + i + ";"); |
95 source += "const x = 10; assertEquals(10, x); x = 11; assertEquals(10, x)"; | 95 source += "const x = 10; assertEquals(10, x); x = 11; assertEquals(10, x)"; |
96 eval(source); | 96 eval(source); |
97 } | 97 } |
98 | 98 |
99 testInitSlowCaseExtension(); | 99 testInitSlowCaseExtension(); |
100 | 100 |
101 function testAssignSurroundingContextSlot() { | 101 function testAssignSurroundingContextSlot() { |
102 var x = 12; | 102 var x = 12; |
103 function local() { | 103 function local() { |
104 var source = "delete x; const x = 13; assertEquals(13, x)"; | 104 var source = "delete x; const x = 13; assertEquals(13, x)"; |
105 eval(source); | 105 eval(source); |
106 } | 106 } |
107 local(); | 107 local(); |
108 assertEquals(13, x); | 108 assertEquals(13, x); |
109 } | 109 } |
110 | 110 |
111 testAssignSurroundingContextSlot(); | 111 testAssignSurroundingContextSlot(); |
OLD | NEW |