Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e271d0b2a5d33e006e8e9aa21a7c29479a91d69 |
--- /dev/null |
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+part of dart2js.js_emitter.startup_emitter.model_emitter; |
+ |
+/** |
+ * This class builds a JavaScript tree for a given fragment. |
+ * |
+ * A fragment is generally written into a separate file so that it can be |
+ * loaded dynamically when a deferred library is loaded. |
+ * |
+ * This class is stateless and can be reused for different fragments. |
+ */ |
+class FragmentEmitter { |
+ final Compiler compiler; |
+ final Namer namer; |
+ final JavaScriptBackend backend; |
+ final ConstantEmitter constantEmitter; |
+ final ModelEmitter modelEmitter; |
+ |
+ FragmentEmitter(this.compiler, this.namer, this.backend, this.constantEmitter, |
+ this.modelEmitter); |
+ |
+ js.Expression generateEmbeddedGlobalAccess(String global) => |
+ modelEmitter.generateEmbeddedGlobalAccess(global); |
+ |
+ js.Expression generateConstantReference(ConstantValue value) => |
+ modelEmitter.generateConstantReference(value); |
+ |
+ js.Statement emitMainFragment(Program program) { |
+ MainFragment fragment = program.fragments.first; |
+ throw new UnimplementedError('emitMain'); |
+ } |
+ |
+ js.Statement emitDeferredFragment(DeferredFragment fragment, |
+ js.Expression deferredTypes, |
+ List<Holder> holders) { |
+ throw new UnimplementedError('emitDeferred'); |
+ } |
+} |