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

Unified Diff: lib/src/codegen/js_printer.dart

Issue 1767803002: a few small refactorings to closure workarounds (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/codegen/js_metalet.dart ('k') | lib/src/codegen/side_effect_analysis.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_printer.dart
diff --git a/lib/src/codegen/js_printer.dart b/lib/src/codegen/js_printer.dart
index 3325870303cabdb4775e9cf1be0b8a73970e8f26..542e0d5f57b2d9abe8dcb9e1aad0829c4c9ab1f7 100644
--- a/lib/src/codegen/js_printer.dart
+++ b/lib/src/codegen/js_printer.dart
@@ -18,7 +18,9 @@ import 'js_names.dart' show TemporaryNamer;
String writeJsLibrary(
JS.Program jsTree, String outputPath, String inputDir, Uri serverUri,
- {bool emitSourceMaps: false, FileSystem fileSystem}) {
+ {bool emitSourceMaps: false,
+ bool emitTypes: false,
+ FileSystem fileSystem}) {
var outFilename = path.basename(outputPath);
var outDir = path.dirname(outputPath);
@@ -32,7 +34,7 @@ String writeJsLibrary(
}
var opts = new JS.JavaScriptPrintingOptions(
- shouldEmitTypes: true,
+ emitTypes: emitTypes,
allowKeywordsInProperties: true,
allowSingleLineIfStatements: true);
var jsNamer = new TemporaryNamer(jsTree);
@@ -45,6 +47,8 @@ String writeJsLibrary(
// Write output file and source map
text = printer.text;
var sourceMap = JSON.decode(printer.map);
+ // TODO(jmesserly): I'm not sure where this logic came from, but we should
+ // upstream this, rather than workaround source_map's formatting ourselves.
var sourceMapText = new JsonEncoder.withIndent(' ').convert(sourceMap);
// Convert:
// "names": [
« no previous file with comments | « lib/src/codegen/js_metalet.dart ('k') | lib/src/codegen/side_effect_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698