Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Issue 1229913002: dart2js: add FragmentEmitter for startup-emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comment. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698