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 library pub.asset.transformer_isolate; | 5 library pub.asset.transformer_isolate; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:isolate'; | 8 import 'dart:isolate'; |
9 import 'dart:mirrors'; | 9 import 'dart:mirrors'; |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 var name = new Symbol("${MirrorSystem.getName(classMirror.simpleName)}" | 86 var name = new Symbol("${MirrorSystem.getName(classMirror.simpleName)}" |
87 ".$constructor"); | 87 ".$constructor"); |
88 var candidate = classMirror.declarations[name]; | 88 var candidate = classMirror.declarations[name]; |
89 if (candidate is MethodMirror && candidate.isConstructor) return candidate; | 89 if (candidate is MethodMirror && candidate.isConstructor) return candidate; |
90 return null; | 90 return null; |
91 } | 91 } |
92 | 92 |
93 // Older barbacks don't support [AggregateTransformer], and calling | 93 // Older barbacks don't support [AggregateTransformer], and calling |
94 // [reflectClass] on an undefined class will throw an error, so we just define a | 94 // [reflectClass] on an undefined class will throw an error, so we just define a |
95 // null getter for them. | 95 // null getter for them. |
96 //# if barback >=0.14.1-dev | 96 //# if barback >=0.14.1 |
97 ClassMirror get _aggregateTransformerClass => | 97 ClassMirror get _aggregateTransformerClass => |
98 reflectClass(AggregateTransformer); | 98 reflectClass(AggregateTransformer); |
99 //# else | 99 //# else |
100 //> ClassMirror get _aggregateTransformerClass => null; | 100 //> ClassMirror get _aggregateTransformerClass => null; |
101 //# end | 101 //# end |
OLD | NEW |