Index: pkg/compiler/lib/src/js_backend/backend.dart |
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
index 6c2e126ca890bd53239698b05f65c12321daea08..1ddb3d632f829bdf07d48d0228f350c5c3b2c97f 100644 |
--- a/pkg/compiler/lib/src/js_backend/backend.dart |
+++ b/pkg/compiler/lib/src/js_backend/backend.dart |
@@ -616,8 +616,9 @@ class JavaScriptBackend extends Backend { |
bool enabledNoSuchMethod = false; |
+ final SourceInformationStrategy sourceInformationStrategy; |
+ |
JavaScriptBackend(Compiler compiler, |
- SourceInformationFactory sourceInformationFactory, |
{bool generateSourceMap: true}) |
: namer = determineNamer(compiler), |
oneShotInterceptors = new Map<String, Selector>(), |
@@ -625,6 +626,12 @@ class JavaScriptBackend extends Backend { |
rti = new RuntimeTypes(compiler), |
specializedGetInterceptors = new Map<String, Set<ClassElement>>(), |
annotations = new Annotations(compiler), |
+ this.sourceInformationStrategy = |
+ generateSourceMap |
+ ? (USE_NEW_SOURCE_INFO |
+ ? const PositionSourceInformationStrategy() |
+ : const StartEndSourceInformationStrategy()) |
+ : const JavaScriptSourceInformationStrategy(), |
super(compiler) { |
emitter = new CodeEmitterTask(compiler, namer, generateSourceMap); |
typeVariableHandler = new TypeVariableHandler(compiler); |
@@ -635,8 +642,8 @@ class JavaScriptBackend extends Backend { |
patchResolverTask = new PatchResolverTask(compiler); |
functionCompiler = compiler.useCpsIr |
? new CpsFunctionCompiler( |
- compiler, this, sourceInformationFactory) |
- : new SsaFunctionCompiler(this, sourceInformationFactory); |
+ compiler, this, sourceInformationStrategy) |
+ : new SsaFunctionCompiler(this, sourceInformationStrategy); |
} |
ConstantSystem get constantSystem => constants.constantSystem; |