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

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
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..6a60bc2791548e09cd68e640462ace07fe440cf3 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,9 @@ class CodeBuffer implements StringBuffer {
if (object is CodeBuffer) {
return addBuffer(object);
}
+ if (mappedRangeCounter == 0) {
floitsch 2012/09/05 14:22:18 one line.
podivilov 2012/09/06 10:52:25 Done.
+ setSourceLocation(null, null);
+ }
buffer.add(object.toString());
return this;
}
@@ -67,6 +71,15 @@ class CodeBuffer implements StringBuffer {
return buffer.toString();
}
+ void beginMappedRange() {
+ mappedRangeCounter += 1;
floitsch 2012/09/05 14:22:18 ++
podivilov 2012/09/06 10:52:25 Done.
+ }
+
+ void endMappedRange() {
+ assert(mappedRangeCounter > 0);
+ mappedRangeCounter -= 1;
floitsch 2012/09/05 14:22:18 --
podivilov 2012/09/06 10:52:25 Done.
+ }
+
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') | lib/compiler/implementation/js/printer.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698