| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Regression test for dart2js, that used to minify a captured |
| 6 // variable's name to the same name as inherited Object methods. |
| 7 |
| 8 var array = [new A()]; |
| 9 |
| 10 class A { |
| 11 operator==(other) { |
| 12 return true; |
| 13 } |
| 14 } |
| 15 |
| 16 foo() { |
| 17 // Use lots of variables, to maximize the chance of collisions. |
| 18 var a = 42; |
| 19 var b = 42; |
| 20 var c = 42; |
| 21 var d = 42; |
| 22 var e = 42; |
| 23 var f = 42; |
| 24 var g = 42; |
| 25 var h = 42; |
| 26 var i = 42; |
| 27 var j = 42; |
| 28 var k = 42; |
| 29 var l = 42; |
| 30 var m = 42; |
| 31 var n = 42; |
| 32 array[0] = () { |
| 33 return a + b + c + d + e + f + g + h + i + j + k + l + m + n; |
| 34 }; |
| 35 } |
| 36 |
| 37 main() { |
| 38 foo(); |
| 39 if (array[0] == new A()) { |
| 40 throw 'Test failed'; |
| 41 } |
| 42 if (array[0]() != 42 * 14) { |
| 43 throw 'Test failed'; |
| 44 } |
| 45 } |
| OLD | NEW |