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

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

Issue 1100723002: Add SourceInformationFactory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 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/source_information.dart ('k') | pkg/compiler/lib/src/js_backend/backend.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 c6a1a2b70203a705cab831e9200ce900f3556065..378b89e9b65052ab924cf380f30d0fd3f5f1a2e5 100644
--- a/pkg/compiler/lib/src/js/js.dart
+++ b/pkg/compiler/lib/src/js/js.dart
@@ -7,6 +7,7 @@ library js;
import 'package:js_ast/js_ast.dart';
export 'package:js_ast/js_ast.dart';
+import '../helpers/helpers.dart';
import '../io/code_output.dart' show CodeBuffer;
import '../io/source_information.dart' show SourceInformation;
import '../js_emitter/js_emitter.dart' show USE_NEW_EMITTER;
@@ -38,14 +39,17 @@ class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext {
Dart2JSJavaScriptPrintingContext(leg.Compiler this.compiler,
DumpInfoTask this.monitor);
+ @override
void error(String message) {
compiler.internalError(NO_LOCATION_SPANNABLE, message);
}
+ @override
void emit(String string) {
outBuffer.add(string);
}
+ @override
void enterNode(Node node, int startPosition) {
SourceInformation sourceInformation = node.sourceInformation;
if (sourceInformation != null) {
@@ -65,6 +69,11 @@ class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext {
int closingPosition) {
SourceInformation sourceInformation = node.sourceInformation;
if (sourceInformation != null) {
+ if (closingPosition != null &&
+ sourceInformation.closingPosition != null) {
+ outBuffer.addSourceLocation(
+ closingPosition, sourceInformation.closingPosition);
+ }
if (sourceInformation.endPosition != null) {
outBuffer.addSourceLocation(endPosition, sourceInformation.endPosition);
}
« no previous file with comments | « pkg/compiler/lib/src/io/source_information.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698