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

Unified Diff: lib/compiler/implementation/code_buffer.dart

Issue 10911091: Add empty mapping entries for the ranges of generated JavaScript that don't map to any Dart source … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 8 years, 3 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 | « no previous file | lib/compiler/implementation/js/printer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/code_buffer.dart
diff --git a/lib/compiler/implementation/code_buffer.dart b/lib/compiler/implementation/code_buffer.dart
index 3c3053e429942e4cfa4f7018efbf1998d6576e7b..02c04d9607c3e94c1a7ef93ff00fa8873bc1a186 100644
--- a/lib/compiler/implementation/code_buffer.dart
+++ b/lib/compiler/implementation/code_buffer.dart
@@ -6,6 +6,7 @@ class CodeBuffer implements StringBuffer {
StringBuffer buffer;
List<SourceLocation> sourceLocations;
int lastBufferOffset = 0;
+ int mappedRangeCounter = 0;
CodeBuffer()
: buffer = new StringBuffer(),
@@ -25,6 +26,7 @@ class CodeBuffer implements StringBuffer {
if (object is CodeBuffer) {
return addBuffer(object);
}
+ if (mappedRangeCounter == 0) setSourceLocation(null, null);
buffer.add(object.toString());
return this;
}
@@ -67,6 +69,15 @@ class CodeBuffer implements StringBuffer {
return buffer.toString();
}
+ void beginMappedRange() {
+ ++mappedRangeCounter;
+ }
+
+ void endMappedRange() {
+ assert(mappedRangeCounter > 0);
+ --mappedRangeCounter;
+ }
+
void setSourceLocation(Element element, Token token) {
int offsetDelta = buffer.length - lastBufferOffset;
sourceLocations.add(new SourceLocation(element, token, offsetDelta));
« no previous file with comments | « no previous file | lib/compiler/implementation/js/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698