OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 |
| 7 /** |
| 8 * This class builds a JavaScript tree for a given fragment. |
| 9 * |
| 10 * A fragment is generally written into a separate file so that it can be |
| 11 * loaded dynamically when a deferred library is loaded. |
| 12 * |
| 13 * This class is stateless and can be reused for different fragments. |
| 14 */ |
| 15 class FragmentEmitter { |
| 16 final Compiler compiler; |
| 17 final Namer namer; |
| 18 final JavaScriptBackend backend; |
| 19 final ConstantEmitter constantEmitter; |
| 20 final ModelEmitter modelEmitter; |
| 21 |
| 22 FragmentEmitter(this.compiler, this.namer, this.backend, this.constantEmitter, |
| 23 this.modelEmitter); |
| 24 |
| 25 js.Expression generateEmbeddedGlobalAccess(String global) => |
| 26 modelEmitter.generateEmbeddedGlobalAccess(global); |
| 27 |
| 28 js.Expression generateConstantReference(ConstantValue value) => |
| 29 modelEmitter.generateConstantReference(value); |
| 30 |
| 31 js.Statement emitMainFragment(Program program) { |
| 32 MainFragment fragment = program.fragments.first; |
| 33 throw new UnimplementedError('emitMain'); |
| 34 } |
| 35 |
| 36 js.Statement emitDeferredFragment(DeferredFragment fragment, |
| 37 js.Expression deferredTypes, |
| 38 List<Holder> holders) { |
| 39 throw new UnimplementedError('emitDeferred'); |
| 40 } |
| 41 } |
OLD | NEW |