OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.target_implementation; | 5 library fasta.target_implementation; |
6 | 6 |
7 import 'package:kernel/target/targets.dart' as backend show Target; | 7 import 'package:kernel/target/targets.dart' as backend show Target; |
8 | 8 |
9 import 'builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; | 9 import 'builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; |
10 | 10 |
| 11 import 'compiler_context.dart' show CompilerContext; |
| 12 |
11 import 'loader.dart' show Loader; | 13 import 'loader.dart' show Loader; |
12 | 14 |
13 import 'target.dart' show Target; | 15 import 'target.dart' show Target; |
14 | 16 |
15 import 'ticker.dart' show Ticker; | 17 import 'ticker.dart' show Ticker; |
16 | 18 |
17 import 'uri_translator.dart' show UriTranslator; | 19 import 'uri_translator.dart' show UriTranslator; |
18 | 20 |
19 /// Provides the implementation details used by a loader for a target. | 21 /// Provides the implementation details used by a loader for a target. |
20 abstract class TargetImplementation extends Target { | 22 abstract class TargetImplementation extends Target { |
21 final UriTranslator uriTranslator; | 23 final UriTranslator uriTranslator; |
22 | 24 |
23 final backend.Target backendTarget; | 25 final backend.Target backendTarget; |
24 | 26 |
| 27 final CompilerContext context = CompilerContext.current; |
| 28 |
25 Builder cachedAbstractClassInstantiationError; | 29 Builder cachedAbstractClassInstantiationError; |
26 Builder cachedCompileTimeError; | 30 Builder cachedCompileTimeError; |
27 Builder cachedDuplicatedFieldInitializerError; | 31 Builder cachedDuplicatedFieldInitializerError; |
28 Builder cachedFallThroughError; | 32 Builder cachedFallThroughError; |
29 Builder cachedNativeAnnotation; | 33 Builder cachedNativeAnnotation; |
30 | 34 |
31 TargetImplementation(Ticker ticker, this.uriTranslator, this.backendTarget) | 35 TargetImplementation(Ticker ticker, this.uriTranslator, this.backendTarget) |
32 : super(ticker); | 36 : super(ticker); |
33 | 37 |
34 /// Creates a [LibraryBuilder] corresponding to [uri], if one doesn't exist | 38 /// Creates a [LibraryBuilder] corresponding to [uri], if one doesn't exist |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void readPatchFiles(LibraryBuilder library) { | 106 void readPatchFiles(LibraryBuilder library) { |
103 assert(library.uri.scheme == "dart"); | 107 assert(library.uri.scheme == "dart"); |
104 List<Uri> patches = uriTranslator.getDartPatches(library.uri.path); | 108 List<Uri> patches = uriTranslator.getDartPatches(library.uri.path); |
105 if (patches != null) { | 109 if (patches != null) { |
106 for (Uri patch in patches) { | 110 for (Uri patch in patches) { |
107 library.loader.read(patch, -1, fileUri: patch, isPatch: true); | 111 library.loader.read(patch, -1, fileUri: patch, isPatch: true); |
108 } | 112 } |
109 } | 113 } |
110 } | 114 } |
111 } | 115 } |
OLD | NEW |