| 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 '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../compiler.dart' show | 10 import '../compiler.dart' show |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 import '../io/source_information.dart' show | 38 import '../io/source_information.dart' show |
| 39 SourceInformationStrategy; | 39 SourceInformationStrategy; |
| 40 import '../js_backend/js_backend.dart' as js_backend show | 40 import '../js_backend/js_backend.dart' as js_backend show |
| 41 JavaScriptBackend; | 41 JavaScriptBackend; |
| 42 import '../library_loader.dart' show | 42 import '../library_loader.dart' show |
| 43 LibraryLoader, | 43 LibraryLoader, |
| 44 LoadedLibraries; | 44 LoadedLibraries; |
| 45 import '../native/native.dart' as native show | 45 import '../native/native.dart' as native show |
| 46 NativeEnqueuer; | 46 NativeEnqueuer; |
| 47 import '../patch_parser.dart' show | 47 import '../patch_parser.dart' show |
| 48 checkNativeAnnotation; | 48 checkNativeAnnotation, checkJsInteropAnnotation; |
| 49 import '../resolution/tree_elements.dart' show | 49 import '../resolution/tree_elements.dart' show |
| 50 TreeElements; | 50 TreeElements; |
| 51 import '../tree/tree.dart' show | 51 import '../tree/tree.dart' show |
| 52 Node, | 52 Node, |
| 53 Send; | 53 Send; |
| 54 import '../universe/call_structure.dart' show | 54 import '../universe/call_structure.dart' show |
| 55 CallStructure; | 55 CallStructure; |
| 56 | 56 |
| 57 import 'codegen.dart' show | 57 import 'codegen.dart' show |
| 58 CodegenWorkItem; | 58 CodegenWorkItem; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 /// This method is called immediately after the [library] and its parts have | 286 /// This method is called immediately after the [library] and its parts have |
| 287 /// been scanned. | 287 /// been scanned. |
| 288 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { | 288 Future onLibraryScanned(LibraryElement library, LibraryLoader loader) { |
| 289 if (library.canUseNative) { | 289 if (library.canUseNative) { |
| 290 library.forEachLocalMember((Element element) { | 290 library.forEachLocalMember((Element element) { |
| 291 if (element.isClass) { | 291 if (element.isClass) { |
| 292 checkNativeAnnotation(compiler, element); | 292 checkNativeAnnotation(compiler, element); |
| 293 } | 293 } |
| 294 }); | 294 }); |
| 295 } | 295 } |
| 296 checkJsInteropAnnotation(compiler, library); |
| 297 library.forEachLocalMember((Element element) { |
| 298 checkJsInteropAnnotation(compiler, element); |
| 299 if (element.isClass && element.isJsInterop) { |
| 300 ClassElement classElement = element; |
| 301 classElement.forEachMember((_, memberElement) { |
| 302 checkJsInteropAnnotation(compiler, memberElement); |
| 303 }); |
| 304 } |
| 305 }); |
| 296 return new Future.value(); | 306 return new Future.value(); |
| 297 } | 307 } |
| 298 | 308 |
| 299 /// This method is called when all new libraries loaded through | 309 /// This method is called when all new libraries loaded through |
| 300 /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports | 310 /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports |
| 301 /// have been computed. | 311 /// have been computed. |
| 302 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { | 312 Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { |
| 303 return new Future.value(); | 313 return new Future.value(); |
| 304 } | 314 } |
| 305 | 315 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 /// Returns the constant expression of [node], or `null` if [node] is not | 402 /// Returns the constant expression of [node], or `null` if [node] is not |
| 393 /// a constant expression. | 403 /// a constant expression. |
| 394 ConstantExpression getConstant(Node node); | 404 ConstantExpression getConstant(Node node); |
| 395 | 405 |
| 396 /// Registers [type] as instantiated. | 406 /// Registers [type] as instantiated. |
| 397 void registerInstantiatedType(InterfaceType type); | 407 void registerInstantiatedType(InterfaceType type); |
| 398 | 408 |
| 399 /// Resolves [typeName] to a type in the context of [node]. | 409 /// Resolves [typeName] to a type in the context of [node]. |
| 400 DartType resolveTypeFromString(Node node, String typeName); | 410 DartType resolveTypeFromString(Node node, String typeName); |
| 401 } | 411 } |
| OLD | NEW |