OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Regression test for dart2js, that used to minify a captured | 5 // Regression test for dart2js, that used to minify a captured |
6 // variable's name to the same name as inherited Object methods. | 6 // variable's name to the same name as inherited Object methods. |
7 | 7 |
8 var array = [new A()]; | 8 var array = [new A()]; |
9 | 9 |
10 class A { | 10 class A { |
11 operator==(other) { | 11 operator ==(other) { |
12 return true; | 12 return true; |
13 } | 13 } |
14 } | 14 } |
15 | 15 |
16 foo() { | 16 foo() { |
17 // Use lots of variables, to maximize the chance of collisions. | 17 // Use lots of variables, to maximize the chance of collisions. |
18 var a = 42; | 18 var a = 42; |
19 var b = 42; | 19 var b = 42; |
20 var c = 42; | 20 var c = 42; |
21 var d = 42; | 21 var d = 42; |
(...skipping 14 matching lines...) Expand all Loading... |
36 | 36 |
37 main() { | 37 main() { |
38 foo(); | 38 foo(); |
39 if (array[0] == new A()) { | 39 if (array[0] == new A()) { |
40 throw 'Test failed'; | 40 throw 'Test failed'; |
41 } | 41 } |
42 if (array[0]() != 42 * 14) { | 42 if (array[0]() != 42 * 14) { |
43 throw 'Test failed'; | 43 throw 'Test failed'; |
44 } | 44 } |
45 } | 45 } |
OLD | NEW |