Index: pkg/compiler/lib/src/compiler.dart |
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
index 88368dd5bfc42c99f764193586f22810a87e7e9c..e8fdf36d61835c5e296e6e0d986de03966df7448 100644 |
--- a/pkg/compiler/lib/src/compiler.dart |
+++ b/pkg/compiler/lib/src/compiler.dart |
@@ -272,6 +272,11 @@ abstract class Backend { |
/// Backend callback methods for the resolution phase. |
ResolutionCallbacks get resolutionCallbacks; |
+ /// The strategy used for collecting and emitting source information. |
+ SourceInformationStrategy get sourceInformationStrategy { |
+ return const SourceInformationStrategy(); |
+ } |
+ |
// TODO(johnniwinther): Move this to the JavaScriptBackend. |
String get patchVersion => null; |
@@ -1093,17 +1098,10 @@ abstract class Compiler implements DiagnosticListener { |
globalDependencies = |
new CodegenRegistry(this, new TreeElementMapping(null)); |
- SourceInformationFactory sourceInformationFactory = |
- const SourceInformationFactory(); |
- if (generateSourceMap) { |
- sourceInformationFactory = |
- const bool.fromEnvironment('USE_NEW_SOURCE_INFO', defaultValue: false) |
- ? const PositionSourceInformationFactory() |
- : const StartEndSourceInformationFactory(); |
- } |
if (emitJavaScript) { |
- js_backend.JavaScriptBackend jsBackend = new js_backend.JavaScriptBackend( |
- this, sourceInformationFactory, generateSourceMap: generateSourceMap); |
+ js_backend.JavaScriptBackend jsBackend = |
+ new js_backend.JavaScriptBackend( |
+ this, generateSourceMap: generateSourceMap); |
backend = jsBackend; |
} else { |
backend = new dart_backend.DartBackend(this, strips, |
@@ -1122,7 +1120,7 @@ abstract class Compiler implements DiagnosticListener { |
resolver = new ResolverTask(this, backend.constantCompilerTask), |
closureToClassMapper = new closureMapping.ClosureTask(this), |
checker = new TypeCheckerTask(this), |
- irBuilder = new IrBuilderTask(this, sourceInformationFactory), |
+ irBuilder = new IrBuilderTask(this, backend.sourceInformationStrategy), |
typesTask = new ti.TypesTask(this), |
constants = backend.constantCompilerTask, |
deferredLoadTask = new DeferredLoadTask(this), |