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 dart2js.backend_api; | 5 library dart2js.backend_api; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
10 Compiler; | 10 Compiler; |
(...skipping 29 matching lines...) Expand all Loading... | |
40 import '../io/source_information.dart' show | 40 import '../io/source_information.dart' show |
41 SourceInformationStrategy; | 41 SourceInformationStrategy; |
42 import '../js_backend/js_backend.dart' as js_backend show | 42 import '../js_backend/js_backend.dart' as js_backend show |
43 JavaScriptBackend; | 43 JavaScriptBackend; |
44 import '../library_loader.dart' show | 44 import '../library_loader.dart' show |
45 LibraryLoader, | 45 LibraryLoader, |
46 LoadedLibraries; | 46 LoadedLibraries; |
47 import '../native/native.dart' as native show | 47 import '../native/native.dart' as native show |
48 NativeEnqueuer; | 48 NativeEnqueuer; |
49 import '../patch_parser.dart' show | 49 import '../patch_parser.dart' show |
50 checkNativeAnnotation; | 50 checkNativeAnnotation, checkJsInteropAnnotation; |
51 import '../resolution/tree_elements.dart' show | 51 import '../resolution/tree_elements.dart' show |
52 TreeElements; | 52 TreeElements; |
53 import '../tree/tree.dart' show | 53 import '../tree/tree.dart' show |
54 Node, | 54 Node, |
55 Send; | 55 Send; |
56 import '../universe/call_structure.dart' show | 56 import '../universe/call_structure.dart' show |
57 CallStructure; | 57 CallStructure; |
58 | 58 |
59 import 'codegen.dart' show | 59 import 'codegen.dart' show |
60 CodegenWorkItem; | 60 CodegenWorkItem; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 /// This method is called immediately after the [library] and its parts have | 289 /// This method is called immediately after the [library] and its parts have |
290 /// been scanned. | 290 /// been scanned. |
291 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { | 291 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { |
292 if (library.canUseNative) { | 292 if (library.canUseNative) { |
293 library.forEachLocalMember((Element element) { | 293 library.forEachLocalMember((Element element) { |
294 if (element.isClass) { | 294 if (element.isClass) { |
295 checkNativeAnnotation(compiler, element); | 295 checkNativeAnnotation(compiler, element); |
296 } | 296 } |
297 }); | 297 }); |
298 } | 298 } |
299 checkJsInteropAnnotation(compiler, library); | |
300 library.forEachLocalMember((Element element) { | |
301 checkJsInteropAnnotation(compiler, element); | |
302 if (element.isClass) { | |
sra1
2015/10/06 21:42:17
Is there a way to defer the member checking?
If th
Jacob
2015/10/13 01:19:22
They aren't. Added a short circuit based on
eleme
| |
303 ClassElement classElement = element; | |
304 classElement.forEachMember((_, memberElement) { | |
305 checkJsInteropAnnotation(compiler, memberElement); | |
306 }); | |
307 } | |
308 }); | |
299 return new Future.value(); | 309 return new Future.value(); |
300 } | 310 } |
301 | 311 |
302 /// This method is called when all new libraries loaded through | 312 /// This method is called when all new libraries loaded through |
303 /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports | 313 /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports |
304 /// have been computed. | 314 /// have been computed. |
305 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { | 315 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { |
306 return new Future.value(); | 316 return new Future.value(); |
307 } | 317 } |
308 | 318 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
395 /// Returns the constant expression of [node], or `null` if [node] is not | 405 /// Returns the constant expression of [node], or `null` if [node] is not |
396 /// a constant expression. | 406 /// a constant expression. |
397 ConstantExpression getConstant(Node node); | 407 ConstantExpression getConstant(Node node); |
398 | 408 |
399 /// Registers [type] as instantiated. | 409 /// Registers [type] as instantiated. |
400 void registerInstantiatedType(InterfaceType type); | 410 void registerInstantiatedType(InterfaceType type); |
401 | 411 |
402 /// Resolves [typeName] to a type in the context of [node]. | 412 /// Resolves [typeName] to a type in the context of [node]. |
403 DartType resolveTypeFromString(Node node, String typeName); | 413 DartType resolveTypeFromString(Node node, String typeName); |
404 } | 414 } |
OLD | NEW |