| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Test for conflicting variable bindings. | 5 // Test for conflicting variable bindings. |
| 6 | 6 |
| 7 function CheckException(e) { | 7 function CheckException(e) { |
| 8 var string = e.toString(); | 8 var string = e.toString(); |
| 9 assertTrue(string.indexOf("has already been declared") >= 0 || | 9 assertTrue(string.indexOf("has already been declared") >= 0 || |
| 10 string.indexOf("redeclaration") >= 0); | 10 string.indexOf("redeclaration") >= 0); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Test conflicting catch/var bindings. | 163 // Test conflicting catch/var bindings. |
| 164 for (var v = 0; v < varbinds.length; ++v) { | 164 for (var v = 0; v < varbinds.length; ++v) { |
| 165 TestNoConflict('try {} catch(x) {' + varbinds[v] + '}'); | 165 TestNoConflict('try {} catch(x) {' + varbinds[v] + '}'); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Test conflicting parameter/var bindings. | 168 // Test conflicting parameter/var bindings. |
| 169 for (var v = 0; v < varbinds.length; ++v) { | 169 for (var v = 0; v < varbinds.length; ++v) { |
| 170 TestNoConflict('(function (x) {' + varbinds[v] + '})();'); | 170 TestNoConflict('(function (x) {' + varbinds[v] + '})();'); |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Test conflicting catch/function bindings. |
| 174 TestNoConflict('try {} catch(x) {' + funbind + '}'); |
| 175 |
| 173 // Test conflicting parameter/function bindings. | 176 // Test conflicting parameter/function bindings. |
| 174 TestNoConflict('(function (x) {' + funbind + '})();'); | 177 TestNoConflict('(function (x) {' + funbind + '})();'); |
| OLD | NEW |