OLD | NEW |
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 js; | 5 library js; |
6 | 6 |
7 import 'package:js_ast/js_ast.dart'; | 7 import 'package:js_ast/js_ast.dart'; |
8 export 'package:js_ast/js_ast.dart'; | 8 export 'package:js_ast/js_ast.dart'; |
9 | 9 |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 24 matching lines...) Expand all Loading... |
35 renamerForNames: renamerForNames); | 35 renamerForNames: renamerForNames); |
36 CodeBuffer outBuffer = new CodeBuffer(); | 36 CodeBuffer outBuffer = new CodeBuffer(); |
37 SourceInformationProcessor sourceInformationProcessor = | 37 SourceInformationProcessor sourceInformationProcessor = |
38 sourceInformationFactory.createProcessor( | 38 sourceInformationFactory.createProcessor( |
39 new SourceLocationsMapper(outBuffer)); | 39 new SourceLocationsMapper(outBuffer)); |
40 Dart2JSJavaScriptPrintingContext context = | 40 Dart2JSJavaScriptPrintingContext context = |
41 new Dart2JSJavaScriptPrintingContext( | 41 new Dart2JSJavaScriptPrintingContext( |
42 compiler.reporter, monitor, outBuffer, sourceInformationProcessor); | 42 compiler.reporter, monitor, outBuffer, sourceInformationProcessor); |
43 Printer printer = new Printer(options, context); | 43 Printer printer = new Printer(options, context); |
44 printer.visit(node); | 44 printer.visit(node); |
45 sourceInformationProcessor.process(node); | 45 sourceInformationProcessor.process(node, outBuffer); |
46 return outBuffer; | 46 return outBuffer; |
47 } | 47 } |
48 | 48 |
49 class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext { | 49 class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext { |
50 final DiagnosticReporter reporter; | 50 final DiagnosticReporter reporter; |
51 final DumpInfoTask monitor; | 51 final DumpInfoTask monitor; |
52 final CodeBuffer outBuffer; | 52 final CodeBuffer outBuffer; |
53 final CodePositionListener codePositionListener; | 53 final CodePositionListener codePositionListener; |
54 | 54 |
55 Dart2JSJavaScriptPrintingContext( | 55 Dart2JSJavaScriptPrintingContext( |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 if (node is PropertyAccess) { | 180 if (node is PropertyAccess) { |
181 PropertyAccess access = node; | 181 PropertyAccess access = node; |
182 if (access.receiver is InterpolatedExpression) { | 182 if (access.receiver is InterpolatedExpression) { |
183 InterpolatedExpression hole = access.receiver; | 183 InterpolatedExpression hole = access.receiver; |
184 return hole.isPositional && hole.nameOrPosition == 0; | 184 return hole.isPositional && hole.nameOrPosition == 0; |
185 } | 185 } |
186 } | 186 } |
187 return false; | 187 return false; |
188 } | 188 } |
OLD | NEW |