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 // Flags: --no-legacy-const --harmony-sloppy --harmony-sloppy-let | 7 // Flags: --no-legacy-const --harmony-sloppy --harmony-sloppy-let --harmony-bloc
k-function |
8 | 8 |
9 function CheckException(e) { | 9 function CheckException(e) { |
10 var string = e.toString(); | 10 var string = e.toString(); |
11 assertTrue(string.indexOf("has already been declared") >= 0 || | 11 assertTrue(string.indexOf("has already been declared") >= 0 || |
12 string.indexOf("redeclaration") >= 0); | 12 string.indexOf("redeclaration") >= 0); |
13 return 'Conflict'; | 13 return 'Conflict'; |
14 } | 14 } |
15 | 15 |
16 | 16 |
17 function TestGlobal(s,e) { | 17 function TestGlobal(s,e) { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // Test conflicting parameter/var bindings. | 165 // Test conflicting parameter/var bindings. |
166 for (var v = 0; v < varbinds.length; ++v) { | 166 for (var v = 0; v < varbinds.length; ++v) { |
167 TestNoConflict('(function (x) {' + varbinds[v] + '})();'); | 167 TestNoConflict('(function (x) {' + varbinds[v] + '})();'); |
168 } | 168 } |
169 | 169 |
170 // Test conflicting catch/function bindings. | 170 // Test conflicting catch/function bindings. |
171 TestNoConflict('try {} catch(x) {' + funbind + '}'); | 171 TestNoConflict('try {} catch(x) {' + funbind + '}'); |
172 | 172 |
173 // Test conflicting parameter/function bindings. | 173 // Test conflicting parameter/function bindings. |
174 TestNoConflict('(function (x) {' + funbind + '})();'); | 174 TestNoConflict('(function (x) {' + funbind + '})();'); |
OLD | NEW |