| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 DartResolutionCallbacks resolutionCallbacks; | 45 DartResolutionCallbacks resolutionCallbacks; |
| 46 | 46 |
| 47 final Set<ClassElement> usedTypeLiterals = new Set<ClassElement>(); | 47 final Set<ClassElement> usedTypeLiterals = new Set<ClassElement>(); |
| 48 | 48 |
| 49 /// The set of visible platform classes that are implemented by instantiated | 49 /// The set of visible platform classes that are implemented by instantiated |
| 50 /// user classes. | 50 /// user classes. |
| 51 final Set<ClassElement> _userImplementedPlatformClasses = | 51 final Set<ClassElement> _userImplementedPlatformClasses = |
| 52 new Set<ClassElement>(); | 52 new Set<ClassElement>(); |
| 53 | 53 |
| 54 bool enableCodegenWithErrorsIfSupported(Spannable node) { | 54 bool enableCodegenWithErrorsIfSupported(Spannable node) { |
| 55 compiler.reportHint(node, | 55 compiler.reportHintMessage( |
| 56 node, |
| 56 MessageKind.GENERIC, | 57 MessageKind.GENERIC, |
| 57 {'text': "Generation of code with compile time errors is not " | 58 {'text': "Generation of code with compile time errors is not " |
| 58 "supported for dart2dart."}); | 59 "supported for dart2dart."}); |
| 59 return false; | 60 return false; |
| 60 } | 61 } |
| 61 | 62 |
| 62 /** | 63 /** |
| 63 * Tells whether it is safe to remove type declarations from variables, | 64 * Tells whether it is safe to remove type declarations from variables, |
| 64 * functions parameters. It becomes not safe if: | 65 * functions parameters. It becomes not safe if: |
| 65 * 1) TypeError is used somewhere in the code, | 66 * 1) TypeError is used somewhere in the code, |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 319 } |
| 319 } | 320 } |
| 320 } | 321 } |
| 321 } | 322 } |
| 322 | 323 |
| 323 } | 324 } |
| 324 | 325 |
| 325 @override | 326 @override |
| 326 bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) { | 327 bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) { |
| 327 // TODO(sigurdm): Implement deferred loading for dart2dart. | 328 // TODO(sigurdm): Implement deferred loading for dart2dart. |
| 328 compiler.reportWarning(node, MessageKind.DEFERRED_LIBRARY_DART_2_DART); | 329 compiler.reportWarningMessage( |
| 330 node, MessageKind.DEFERRED_LIBRARY_DART_2_DART); |
| 329 return false; | 331 return false; |
| 330 } | 332 } |
| 331 } | 333 } |
| 332 | 334 |
| 333 class DartResolutionCallbacks extends ResolutionCallbacks { | 335 class DartResolutionCallbacks extends ResolutionCallbacks { |
| 334 final DartBackend backend; | 336 final DartBackend backend; |
| 335 | 337 |
| 336 DartResolutionCallbacks(this.backend); | 338 DartResolutionCallbacks(this.backend); |
| 337 | 339 |
| 338 void onTypeLiteral(DartType type, Registry registry) { | 340 void onTypeLiteral(DartType type, Registry registry) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 518 } |
| 517 | 519 |
| 518 // TODO(johnniwinther): Remove this when values are computed from the | 520 // TODO(johnniwinther): Remove this when values are computed from the |
| 519 // expressions. | 521 // expressions. |
| 520 @override | 522 @override |
| 521 void copyConstantValues(DartConstantTask task) { | 523 void copyConstantValues(DartConstantTask task) { |
| 522 constantCompiler.constantValueMap.addAll( | 524 constantCompiler.constantValueMap.addAll( |
| 523 task.constantCompiler.constantValueMap); | 525 task.constantCompiler.constantValueMap); |
| 524 } | 526 } |
| 525 } | 527 } |
| OLD | NEW |