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

Side by Side Diff: lib/src/codegen/html_codegen.dart

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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 | « lib/src/codegen/ast_builder.dart ('k') | lib/src/codegen/js_codegen.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 import 'package:html/dom.dart';
6 import 'package:html/parser.dart' show parseFragment;
7 import 'package:logging/logging.dart' show Logger;
8
9 // TODO(jmesserly): the string interpolation in these could lead to injection
10 // bugs. Not really a security issue since input is trusted, but the resulting
11 // parse tree may not match expectations if interpolated strings contain quotes.
12
13 /// A script tag that loads the .js code for a compiled library.
14 Node libraryInclude(String jsUrl) =>
15 parseFragment('<script src="$jsUrl"></script>\n');
16
17 /// A script tag that invokes the main function on the entry point library.
18 Node invokeMain(String mainLibraryName) {
19 var code = mainLibraryName == null
20 ? 'console.error("dev_compiler error: main was not generated");'
21 // TODO(vsm): Can we simplify this?
22 // See: https://github.com/dart-lang/dev_compiler/issues/164
23 : "dart_library.start('$mainLibraryName');";
24 return parseFragment('<script>$code</script>\n');
25 }
26
27 final _log = new Logger('dev_compiler.src.codegen.html_codegen');
OLDNEW
« no previous file with comments | « lib/src/codegen/ast_builder.dart ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698