OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Dart2js crashed on this example. It globalized both closures and created | 5 // Dart2js crashed on this example. It globalized both closures and created |
6 // top-level classes for closures (here the globalized_closure{2}). There was a | 6 // top-level classes for closures (here the globalized_closure{2}). There was a |
7 // name-clash (both being named "main_closure") which led to a crash. | 7 // name-clash (both being named "main_closure") which led to a crash. |
8 | 8 |
9 library main; | 9 library main; |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 globalized_closure(); | 25 globalized_closure(); |
26 globalized_closure2(); | 26 globalized_closure2(); |
27 final ms = currentMirrorSystem(); | 27 final ms = currentMirrorSystem(); |
28 var lib = ms.findLibrary(#main); | 28 var lib = ms.findLibrary(#main); |
29 var collectedParents = []; | 29 var collectedParents = []; |
30 var classes = lib.declarations.values; | 30 var classes = lib.declarations.values; |
31 for (var c in classes) { | 31 for (var c in classes) { |
32 if (c is ClassMirror && c.superclass != null) { | 32 if (c is ClassMirror && c.superclass != null) { |
33 collectedParents.add(MirrorSystem.getName(c.superclass.simpleName)); | 33 collectedParents.add(MirrorSystem.getName(c.superclass.simpleName)); |
34 } | 34 } |
35 } | 35 }; |
36 ; | |
37 Expect.isTrue(collectedParents.isEmpty); // //# 00: ok | 36 Expect.isTrue(collectedParents.isEmpty); // //# 00: ok |
38 } | 37 } |
OLD | NEW |