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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 log('Resolving...'); | 298 log('Resolving...'); |
299 phase = Compiler.PHASE_RESOLVING; | 299 phase = Compiler.PHASE_RESOLVING; |
300 backend.enqueueHelpers(enqueuer.resolution); | 300 backend.enqueueHelpers(enqueuer.resolution); |
301 processQueueList(enqueuer.resolution, elementList); | 301 processQueueList(enqueuer.resolution, elementList); |
302 log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.'); | 302 log('Resolved ${enqueuer.resolution.resolvedElements.length} elements.'); |
303 } | 303 } |
304 | 304 |
305 void processQueueList(Enqueuer world, List<LibraryElement> elements) { | 305 void processQueueList(Enqueuer world, List<LibraryElement> elements) { |
306 world.nativeEnqueuer.processNativeClasses(libraries.values); | 306 world.nativeEnqueuer.processNativeClasses(libraries.values); |
307 for (var library in elements) { | 307 for (var library in elements) { |
308 library.forEachLocalMember((element) { | 308 fullyEnqueueLibrary(library); |
309 world.addToWorkList(element); | |
310 }); | |
311 } | 309 } |
312 progress.reset(); | 310 progress.reset(); |
313 world.forEach((WorkItem work) { | 311 world.forEach((WorkItem work) { |
314 withCurrentElement(work.element, () => work.run(this, world)); | 312 withCurrentElement(work.element, () => work.run(this, world)); |
315 }); | 313 }); |
316 } | 314 } |
317 | 315 |
318 String codegen(WorkItem work, Enqueuer world) { | 316 String codegen(WorkItem work, Enqueuer world) { |
319 return null; | 317 return null; |
320 } | 318 } |
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 return new Future.immediate( | 1859 return new Future.immediate( |
1862 new Dart2JsStringConstantMirror.fromString(mirrors, text)); | 1860 new Dart2JsStringConstantMirror.fromString(mirrors, text)); |
1863 } else if (fieldName == 'trimmedText') { | 1861 } else if (fieldName == 'trimmedText') { |
1864 return new Future.immediate( | 1862 return new Future.immediate( |
1865 new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText)); | 1863 new Dart2JsStringConstantMirror.fromString(mirrors, trimmedText)); |
1866 } | 1864 } |
1867 // TODO(johnniwinther): Which exception/error should be thrown here? | 1865 // TODO(johnniwinther): Which exception/error should be thrown here? |
1868 throw new UnsupportedError('InstanceMirror does not have a reflectee'); | 1866 throw new UnsupportedError('InstanceMirror does not have a reflectee'); |
1869 } | 1867 } |
1870 } | 1868 } |
OLD | NEW |