Index: lib/compiler/implementation/compiler.dart |
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart |
index bf51eb7a1c4a8ee12d839c316677aecbf2256d27..554e59592e5cdab909f2375fb4354bba28c69022 100644 |
--- a/lib/compiler/implementation/compiler.dart |
+++ b/lib/compiler/implementation/compiler.dart |
@@ -154,14 +154,18 @@ class Compiler implements DiagnosticListener { |
Compiler([this.tracer = const Tracer(), |
this.enableTypeAssertions = false, |
this.enableUserAssertions = false, |
- bool emitJavascript = true, |
+ bool emitJavaScript = true, |
validateUnparse = false, |
generateSourceMap = true]) |
: libraries = new Map<String, LibraryElement>(), |
world = new World(), |
progress = new Stopwatch.start() { |
namer = new Namer(this); |
- constantHandler = new ConstantHandler(this); |
+ constantHandler = |
+ new ConstantHandler(this, |
+ emitJavaScript |
+ ? const JavaScriptFoldingOperations() |
+ : const DartFoldingOperations()); |
scanner = new ScannerTask(this); |
dietParser = new DietParserTask(this); |
parser = new ParserTask(this); |
@@ -171,7 +175,7 @@ class Compiler implements DiagnosticListener { |
closureToClassMapper = new closureMapping.ClosureTask(this); |
checker = new TypeCheckerTask(this); |
typesTask = new ti.TypesTask(this); |
- backend = emitJavascript ? |
+ backend = emitJavaScript ? |
new js_backend.JavaScriptBackend(this, generateSourceMap) : |
new dart_backend.DartBackend(this, validateUnparse); |
enqueuer = new EnqueueTask(this); |