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

Side by Side Diff: pkg/compiler/lib/src/js/js.dart

Issue 1617083002: Base JavaScript code position computation on JavaScript tracer. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
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 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698