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.kernel_target; | 5 library fasta.kernel_target; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:io' show File, IOSink; | 9 import 'dart:io' show File, IOSink; |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 LibraryBuilder, | 85 LibraryBuilder, |
86 MixinApplicationBuilder, | 86 MixinApplicationBuilder, |
87 NamedMixinApplicationBuilder, | 87 NamedMixinApplicationBuilder, |
88 NamedTypeBuilder, | 88 NamedTypeBuilder, |
89 TypeBuilder, | 89 TypeBuilder, |
90 TypeVariableBuilder; | 90 TypeVariableBuilder; |
91 | 91 |
92 import 'verifier.dart' show verifyProgram; | 92 import 'verifier.dart' show verifyProgram; |
93 | 93 |
94 class KernelTarget extends TargetImplementation { | 94 class KernelTarget extends TargetImplementation { |
| 95 final bool strongMode; |
| 96 |
95 final DillTarget dillTarget; | 97 final DillTarget dillTarget; |
96 | 98 |
97 /// Shared with [CompilerContext]. | 99 /// Shared with [CompilerContext]. |
98 final Map<String, Source> uriToSource; | 100 final Map<String, Source> uriToSource; |
99 | 101 |
100 SourceLoader<Library> loader; | 102 SourceLoader<Library> loader; |
101 Program program; | 103 Program program; |
102 | 104 |
103 final List errors = []; | 105 final List errors = []; |
104 | 106 |
105 final TypeBuilder dynamicType = | 107 final TypeBuilder dynamicType = |
106 new KernelNamedTypeBuilder("dynamic", null, -1, null); | 108 new KernelNamedTypeBuilder("dynamic", null, -1, null); |
107 | 109 |
108 KernelTarget(DillTarget dillTarget, TranslateUri uriTranslator, | 110 KernelTarget( |
| 111 DillTarget dillTarget, TranslateUri uriTranslator, this.strongMode, |
109 [Map<String, Source> uriToSource]) | 112 [Map<String, Source> uriToSource]) |
110 : dillTarget = dillTarget, | 113 : dillTarget = dillTarget, |
111 uriToSource = uriToSource ?? CompilerContext.current.uriToSource, | 114 uriToSource = uriToSource ?? CompilerContext.current.uriToSource, |
112 super(dillTarget.ticker, uriTranslator) { | 115 super(dillTarget.ticker, uriTranslator) { |
113 resetCrashReporting(); | 116 resetCrashReporting(); |
114 loader = createLoader(); | 117 loader = createLoader(); |
115 } | 118 } |
116 | 119 |
117 void addError(file, int charOffset, String message) { | 120 void addError(file, int charOffset, String message) { |
118 Uri uri = file is String ? Uri.parse(file) : file; | 121 Uri uri = file is String ? Uri.parse(file) : file; |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 } | 719 } |
717 for (Constructor constructor in superclass.constructors) { | 720 for (Constructor constructor in superclass.constructors) { |
718 if (constructor.name.name.isEmpty) { | 721 if (constructor.name.name.isEmpty) { |
719 return constructor.function.requiredParameterCount == 0 | 722 return constructor.function.requiredParameterCount == 0 |
720 ? constructor | 723 ? constructor |
721 : null; | 724 : null; |
722 } | 725 } |
723 } | 726 } |
724 return null; | 727 return null; |
725 } | 728 } |
OLD | NEW |