| 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
| 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
| 9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
| 10 class ElementAst { | 10 class ElementAst { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 DartResolutionCallbacks resolutionCallbacks; | 43 DartResolutionCallbacks resolutionCallbacks; |
| 44 | 44 |
| 45 final Set<ClassElement> usedTypeLiterals = new Set<ClassElement>(); | 45 final Set<ClassElement> usedTypeLiterals = new Set<ClassElement>(); |
| 46 | 46 |
| 47 /// The set of visible platform classes that are implemented by instantiated | 47 /// The set of visible platform classes that are implemented by instantiated |
| 48 /// user classes. | 48 /// user classes. |
| 49 final Set<ClassElement> _userImplementedPlatformClasses = | 49 final Set<ClassElement> _userImplementedPlatformClasses = |
| 50 new Set<ClassElement>(); | 50 new Set<ClassElement>(); |
| 51 | 51 |
| 52 bool get canHandleCompilationFailed => false; | 52 bool enableCodegenWithErrorsIfSupported(Spannable node) { |
| 53 compiler.reportHint(node, |
| 54 MessageKind.GENERIC, |
| 55 {'text': "Generation of code with compile time errors is not " |
| 56 "supported for dart2dart."}); |
| 57 return false; |
| 58 } |
| 53 | 59 |
| 54 /** | 60 /** |
| 55 * Tells whether it is safe to remove type declarations from variables, | 61 * Tells whether it is safe to remove type declarations from variables, |
| 56 * functions parameters. It becomes not safe if: | 62 * functions parameters. It becomes not safe if: |
| 57 * 1) TypeError is used somewhere in the code, | 63 * 1) TypeError is used somewhere in the code, |
| 58 * 2) The code has typedefs in right hand side of IS checks, | 64 * 2) The code has typedefs in right hand side of IS checks, |
| 59 * 3) The code has classes which extend typedefs, have type arguments typedefs | 65 * 3) The code has classes which extend typedefs, have type arguments typedefs |
| 60 * or type variable bounds typedefs. | 66 * or type variable bounds typedefs. |
| 61 * These restrictions can be less strict. | 67 * These restrictions can be less strict. |
| 62 */ | 68 */ |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 } | 313 } |
| 308 }); | 314 }); |
| 309 } | 315 } |
| 310 } | 316 } |
| 311 } | 317 } |
| 312 } | 318 } |
| 313 | 319 |
| 314 } | 320 } |
| 315 | 321 |
| 316 @override | 322 @override |
| 317 bool registerDeferredLoading(Spannable node, Registry registry) { | 323 bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) { |
| 318 // TODO(sigurdm): Implement deferred loading for dart2dart. | 324 // TODO(sigurdm): Implement deferred loading for dart2dart. |
| 319 compiler.reportWarning(node, MessageKind.DEFERRED_LIBRARY_DART_2_DART); | 325 compiler.reportWarning(node, MessageKind.DEFERRED_LIBRARY_DART_2_DART); |
| 320 return false; | 326 return false; |
| 321 } | 327 } |
| 322 } | 328 } |
| 323 | 329 |
| 324 class DartResolutionCallbacks extends ResolutionCallbacks { | 330 class DartResolutionCallbacks extends ResolutionCallbacks { |
| 325 final DartBackend backend; | 331 final DartBackend backend; |
| 326 | 332 |
| 327 DartResolutionCallbacks(this.backend); | 333 DartResolutionCallbacks(this.backend); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 class _ElementAstCreationContext implements ElementAstCreationContext { | 523 class _ElementAstCreationContext implements ElementAstCreationContext { |
| 518 final Compiler compiler; | 524 final Compiler compiler; |
| 519 final ConstantSystem constantSystem; | 525 final ConstantSystem constantSystem; |
| 520 | 526 |
| 521 _ElementAstCreationContext(this.compiler, this.constantSystem); | 527 _ElementAstCreationContext(this.compiler, this.constantSystem); |
| 522 | 528 |
| 523 DartTypes get dartTypes => compiler.types; | 529 DartTypes get dartTypes => compiler.types; |
| 524 | 530 |
| 525 InternalErrorFunction get internalError => compiler.internalError; | 531 InternalErrorFunction get internalError => compiler.internalError; |
| 526 } | 532 } |
| OLD | NEW |