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

Unified Diff: lib/src/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/side_effect_analysis.dart ('k') | lib/src/transformer/asset_source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/printer.dart
diff --git a/lib/src/js/printer.dart b/lib/src/js/printer.dart
index cc347255cb69d824453503dc5aeac5ba30f5cda4..955f6d9cbf2a008b9ba05668b3602dbf4bfc4d87 100644
--- a/lib/src/js/printer.dart
+++ b/lib/src/js/printer.dart
@@ -9,7 +9,7 @@ class JavaScriptPrintingOptions {
final bool shouldCompressOutput;
final bool minifyLocalVariables;
final bool preferSemicolonToNewlineInMinifiedOutput;
- final bool shouldEmitTypes;
+ final bool emitTypes;
final bool allowSingleLineIfStatements;
/// True to allow keywords in properties, such as `obj.var` or `obj.function`
@@ -20,7 +20,7 @@ class JavaScriptPrintingOptions {
{this.shouldCompressOutput: false,
this.minifyLocalVariables: false,
this.preferSemicolonToNewlineInMinifiedOutput: false,
- this.shouldEmitTypes: false,
+ this.emitTypes: false,
this.allowKeywordsInProperties: false,
this.allowSingleLineIfStatements: false});
}
@@ -945,7 +945,7 @@ class Printer extends TypeScriptTypePrinter implements NodeVisitor {
visitArrowFun(ArrowFun fun) {
localNamer.enterScope(fun);
if (fun.params.length == 1 &&
- (fun.params.single.type == null || !options.shouldEmitTypes)) {
+ (fun.params.single.type == null || !options.emitTypes)) {
visitNestedExpression(fun.params.single, SPREAD,
newInForInit: false, newAtStatementBegin: false);
} else {
@@ -1094,7 +1094,7 @@ class Printer extends TypeScriptTypePrinter implements NodeVisitor {
}
void outTypeParams(Iterable<Identifier> typeParams) {
- if (typeParams != null && options.shouldEmitTypes && typeParams.isNotEmpty) {
+ if (typeParams != null && options.emitTypes && typeParams.isNotEmpty) {
out("<");
var first = true;
for (var typeParam in typeParams) {
@@ -1119,7 +1119,7 @@ class Printer extends TypeScriptTypePrinter implements NodeVisitor {
out('{');
lineOut();
indentMore();
- if (options.shouldEmitTypes && node.fields != null) {
+ if (options.emitTypes && node.fields != null) {
for (var field in node.fields) {
indent();
visit(field);
@@ -1360,7 +1360,7 @@ class Printer extends TypeScriptTypePrinter implements NodeVisitor {
}
void outTypeAnnotation(TypeRef node) {
- if (node == null || !options.shouldEmitTypes || node.isUnknown) return;
+ if (node == null || !options.emitTypes || node.isUnknown) return;
if (node is OptionalTypeRef) {
out("?: ");
« no previous file with comments | « lib/src/codegen/side_effect_analysis.dart ('k') | lib/src/transformer/asset_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698