OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 mirrors_dart2js; | 5 library mirrors_dart2js; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection' show LinkedHashMap; | 8 import 'dart:collection' show LinkedHashMap; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:uri'; | 10 import 'dart:uri'; |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 log('compilation succeeded'); | 282 log('compilation succeeded'); |
283 return true; | 283 return true; |
284 } | 284 } |
285 | 285 |
286 void runCompilerList(List<Uri> uriList) { | 286 void runCompilerList(List<Uri> uriList) { |
287 scanBuiltinLibraries(); | 287 scanBuiltinLibraries(); |
288 var elementList = <LibraryElement>[]; | 288 var elementList = <LibraryElement>[]; |
289 for (var uri in uriList) { | 289 for (var uri in uriList) { |
290 elementList.add(libraryLoader.loadLibrary(uri, null, uri)); | 290 elementList.add(libraryLoader.loadLibrary(uri, null, uri)); |
291 } | 291 } |
292 libraries.forEach((_, library) { | |
293 maybeEnableJSHelper(library); | |
294 }); | |
295 | 292 |
296 world.populate(); | 293 world.populate(); |
297 | 294 |
298 log('Resolving...'); | 295 log('Resolving...'); |
299 phase = Compiler.PHASE_RESOLVING; | 296 phase = Compiler.PHASE_RESOLVING; |
300 backend.enqueueHelpers(enqueuer.resolution); | 297 backend.enqueueHelpers(enqueuer.resolution); |
301 processQueueList(enqueuer.resolution, elementList); | 298 processQueueList(enqueuer.resolution, elementList); |
302 log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.'); | 299 log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.'); |
303 } | 300 } |
304 | 301 |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1859 return new Future.immediate( | 1856 return new Future.immediate( |
1860 new Dart2JsStringConstantMirror.fromString(mirrors, text)); | 1857 new Dart2JsStringConstantMirror.fromString(mirrors, text)); |
1861 } else if (fieldName == 'trimmedText') { | 1858 } else if (fieldName == 'trimmedText') { |
1862 return new Future.immediate( | 1859 return new Future.immediate( |
1863 new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText)); | 1860 new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText)); |
1864 } | 1861 } |
1865 // TODO(johnniwinther): Which exception/error should be thrown here? | 1862 // TODO(johnniwinther): Which exception/error should be thrown here? |
1866 throw new UnsupportedError('InstanceMirror does not have a reflectee'); | 1863 throw new UnsupportedError('InstanceMirror does not have a reflectee'); |
1867 } | 1864 } |
1868 } | 1865 } |
OLD | NEW |