| 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 { |
| 11 final Node ast; | 11 final Node ast; |
| 12 final TreeElements treeElements; | 12 final TreeElements treeElements; |
| 13 | 13 |
| 14 ElementAst(this.ast, this.treeElements); | 14 ElementAst(this.ast, this.treeElements); |
| 15 } | 15 } |
| 16 | 16 |
| 17 class DartBackend extends Backend { | 17 class DartBackend extends Backend { |
| 18 final List<CompilerTask> tasks; | 18 final List<CompilerTask> tasks; |
| 19 final bool stripAsserts; | 19 final bool stripAsserts; |
| 20 | 20 |
| 21 bool get supportsReflection => true; | 21 bool get supportsReflection => true; |
| 22 | 22 |
| 23 bool get supportsAsyncAwait => true; |
| 24 |
| 23 // TODO(zarah) Maybe change this to a command-line option. | 25 // TODO(zarah) Maybe change this to a command-line option. |
| 24 // Right now, it is set by the tests. | 26 // Right now, it is set by the tests. |
| 25 bool useMirrorHelperLibrary = false; | 27 bool useMirrorHelperLibrary = false; |
| 26 | 28 |
| 27 /// Updated to a [MirrorRenamerImpl] instance if the [useMirrorHelperLibrary] | 29 /// Updated to a [MirrorRenamerImpl] instance if the [useMirrorHelperLibrary] |
| 28 /// field is set and mirror are needed. | 30 /// field is set and mirror are needed. |
| 29 MirrorRenamer mirrorRenamer = const MirrorRenamer(); | 31 MirrorRenamer mirrorRenamer = const MirrorRenamer(); |
| 30 | 32 |
| 31 final DartOutputter outputter; | 33 final DartOutputter outputter; |
| 32 | 34 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 } | 533 } |
| 532 | 534 |
| 533 // TODO(johnniwinther): Remove this when values are computed from the | 535 // TODO(johnniwinther): Remove this when values are computed from the |
| 534 // expressions. | 536 // expressions. |
| 535 @override | 537 @override |
| 536 void copyConstantValues(DartConstantTask task) { | 538 void copyConstantValues(DartConstantTask task) { |
| 537 constantCompiler.constantValueMap | 539 constantCompiler.constantValueMap |
| 538 .addAll(task.constantCompiler.constantValueMap); | 540 .addAll(task.constantCompiler.constantValueMap); |
| 539 } | 541 } |
| 540 } | 542 } |
| OLD | NEW |