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

Unified Diff: pkg/compiler/lib/src/js/js.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/io/start_end_information.dart ('k') | pkg/compiler/lib/src/js/js_debug.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js/js.dart
diff --git a/pkg/compiler/lib/src/js/js.dart b/pkg/compiler/lib/src/js/js.dart
index 837b9feadbcdf1729acf63ba183ff45badeb4504..cefac18a550e8433bd2b5e98db3e028c9cafa4a4 100644
--- a/pkg/compiler/lib/src/js/js.dart
+++ b/pkg/compiler/lib/src/js/js.dart
@@ -8,23 +8,16 @@ import 'package:js_ast/js_ast.dart';
export 'package:js_ast/js_ast.dart';
import '../common.dart';
-import '../compiler.dart' show
- Compiler;
-import '../dump_info.dart' show
- DumpInfoTask;
-import '../io/code_output.dart' show
- CodeBuffer,
- CodeOutput;
-import '../js_emitter/js_emitter.dart' show
- USE_LAZY_EMITTER;
+import '../compiler.dart' show Compiler;
+import '../dump_info.dart' show DumpInfoTask;
+import '../io/code_output.dart' show CodeBuffer, CodeOutput;
+import '../js_emitter/js_emitter.dart' show USE_LAZY_EMITTER;
import 'js_source_mapping.dart';
-String prettyPrint(
- Node node,
- Compiler compiler,
+String prettyPrint(Node node, Compiler compiler,
{bool allowVariableMinification: true,
- Renamer renamerForNames: JavaScriptPrintingOptions.identityRenamer}) {
+ Renamer renamerForNames: JavaScriptPrintingOptions.identityRenamer}) {
// TODO(johnniwinther): Do we need all the options here?
JavaScriptPrintingOptions options = new JavaScriptPrintingOptions(
shouldCompressOutput: compiler.options.enableMinification,
@@ -38,12 +31,10 @@ String prettyPrint(
return context.getText();
}
-CodeBuffer createCodeBuffer(
- Node node,
- Compiler compiler,
+CodeBuffer createCodeBuffer(Node node, Compiler compiler,
{DumpInfoTask monitor,
- bool allowVariableMinification: true,
- Renamer renamerForNames: JavaScriptPrintingOptions.identityRenamer}) {
+ bool allowVariableMinification: true,
+ Renamer renamerForNames: JavaScriptPrintingOptions.identityRenamer}) {
JavaScriptSourceInformationStrategy sourceInformationFactory =
compiler.backend.sourceInformationStrategy;
JavaScriptPrintingOptions options = new JavaScriptPrintingOptions(
@@ -53,8 +44,8 @@ CodeBuffer createCodeBuffer(
renamerForNames: renamerForNames);
CodeBuffer outBuffer = new CodeBuffer();
SourceInformationProcessor sourceInformationProcessor =
- sourceInformationFactory.createProcessor(
- new SourceLocationsMapper(outBuffer));
+ sourceInformationFactory
+ .createProcessor(new SourceLocationsMapper(outBuffer));
Dart2JSJavaScriptPrintingContext context =
new Dart2JSJavaScriptPrintingContext(
compiler.reporter, monitor, outBuffer, sourceInformationProcessor);
@@ -71,10 +62,7 @@ class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext {
final CodePositionListener codePositionListener;
Dart2JSJavaScriptPrintingContext(
- this.reporter,
- this.monitor,
- this.outBuffer,
- this.codePositionListener);
+ this.reporter, this.monitor, this.outBuffer, this.codePositionListener);
@override
void error(String message) {
@@ -90,10 +78,8 @@ class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext {
void enterNode(Node, int startPosition) {}
@override
- void exitNode(Node node,
- int startPosition,
- int endPosition,
- int closingPosition) {
+ void exitNode(
+ Node node, int startPosition, int endPosition, int closingPosition) {
if (monitor != null) {
monitor.recordAstSize(node, endPosition - startPosition);
}
@@ -142,8 +128,7 @@ abstract class ReferenceCountedAstNode implements Node {
///
/// This is used when generated code needs to be represented as a string,
/// for example by the lazy emitter or when generating code generators.
-class UnparsedNode extends DeferredString
- implements AstContainer {
+class UnparsedNode extends DeferredString implements AstContainer {
@override
final Node tree;
final Compiler _compiler;
@@ -167,8 +152,7 @@ class UnparsedNode extends DeferredString
if (tree is LiteralExpression) {
LiteralExpression literalExpression = tree;
String template = literalExpression.template;
- if (template.startsWith("function ") ||
- template.startsWith("{")) {
+ if (template.startsWith("function ") || template.startsWith("{")) {
text = '($text)';
}
}
« no previous file with comments | « pkg/compiler/lib/src/io/start_end_information.dart ('k') | pkg/compiler/lib/src/js/js_debug.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698