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

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

Issue 1182653002: Refactor runtime into libraries, better type reps (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Address comments 2 Created 5 years, 6 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/runtime/dart_utils.js ('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
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dev_compiler.src.codegen.html_codegen; 5 library dev_compiler.src.codegen.html_codegen;
6 6
7 import 'package:html/dom.dart'; 7 import 'package:html/dom.dart';
8 import 'package:html/parser.dart' show parseFragment; 8 import 'package:html/parser.dart' show parseFragment;
9 import 'package:logging/logging.dart' show Logger; 9 import 'package:logging/logging.dart' show Logger;
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 /// A script tag that loads the .js code for a compiled library. 97 /// A script tag that loads the .js code for a compiled library.
98 Node _libraryInclude(String jsUrl) => 98 Node _libraryInclude(String jsUrl) =>
99 parseFragment('<script src="$jsUrl"></script>\n'); 99 parseFragment('<script src="$jsUrl"></script>\n');
100 100
101 /// A script tag that invokes the main function on the entry point library. 101 /// A script tag that invokes the main function on the entry point library.
102 Node _invokeMain(String mainLibraryName) { 102 Node _invokeMain(String mainLibraryName) {
103 var code = mainLibraryName == null 103 var code = mainLibraryName == null
104 ? 'console.error("dev_compiler error: main was not generated");' 104 ? 'console.error("dev_compiler error: main was not generated");'
105 // TODO(vsm): Can we simplify this? 105 // TODO(vsm): Can we simplify this?
106 // See: https://github.com/dart-lang/dev_compiler/issues/164 106 // See: https://github.com/dart-lang/dev_compiler/issues/164
107 : "dart.start('$mainLibraryName');"; 107 : "dart_library.start('$mainLibraryName');";
108 return parseFragment('<script>$code</script>\n'); 108 return parseFragment('<script>$code</script>\n');
109 } 109 }
110 110
111 /// Convert the outputPath to include the hash in it. This function is the 111 /// Convert the outputPath to include the hash in it. This function is the
112 /// reverse of what the server does to determine whether a request needs to have 112 /// reverse of what the server does to determine whether a request needs to have
113 /// cache headers added to it. 113 /// cache headers added to it.
114 _addHash(String outPath, String hash) { 114 _addHash(String outPath, String hash) {
115 // (the ____ prefix makes it look better in the web inspector) 115 // (the ____ prefix makes it look better in the web inspector)
116 return '$outPath?____cached=$hash'; 116 return '$outPath?____cached=$hash';
117 } 117 }
118 118
119 final _log = new Logger('dev_compiler.src.codegen.html_codegen'); 119 final _log = new Logger('dev_compiler.src.codegen.html_codegen');
OLDNEW
« no previous file with comments | « lib/runtime/dart_utils.js ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698