Diff
Modified: trunk/LayoutTests/ChangeLog (98344 => 98345)
--- trunk/LayoutTests/ChangeLog 2011-10-25 14:24:59 UTC (rev 98344)
+++ trunk/LayoutTests/ChangeLog 2011-10-25 14:26:59 UTC (rev 98345)
@@ -1,3 +1,13 @@
+2011-10-24 Pavel Podivilov <podivi...@chromium.org>
+
+ Web Inspector: fix empty line handling in source maps.
+ https://bugs.webkit.org/show_bug.cgi?id=70726
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/debugger/compiler-source-mapping-expected.txt:
+ * inspector/debugger/compiler-source-mapping.html:
+
2011-10-25 Justin Schuh <jsc...@chromium.org>
Check for empty string in parseArcFlag
Modified: trunk/LayoutTests/inspector/debugger/compiler-source-mapping-expected.txt (98344 => 98345)
--- trunk/LayoutTests/inspector/debugger/compiler-source-mapping-expected.txt 2011-10-25 14:24:59 UTC (rev 98344)
+++ trunk/LayoutTests/inspector/debugger/compiler-source-mapping-expected.txt 2011-10-25 14:26:59 UTC (rev 98345)
@@ -5,3 +5,5 @@
Running: testNoMappingEntry
+Running: testEmptyLine
+
Modified: trunk/LayoutTests/inspector/debugger/compiler-source-mapping.html (98344 => 98345)
--- trunk/LayoutTests/inspector/debugger/compiler-source-mapping.html 2011-10-25 14:24:59 UTC (rev 98344)
+++ trunk/LayoutTests/inspector/debugger/compiler-source-mapping.html 2011-10-25 14:26:59 UTC (rev 98345)
@@ -73,6 +73,18 @@
checkMapping(0, 0, "example.js", 0, 0, mapping);
checkMapping(0, 2, "example.js", 0, 2, mapping);
next();
+ },
+
+ function testEmptyLine(next)
+ {
+ var mappingPayload = {
+ "mappings":"AAAA;;;CACA",
+ "sources":["example.js"]
+ };
+ var mapping = new WebInspector.ClosureCompilerSourceMapping(mappingPayload);
+ checkMapping(0, 0, "example.js", 0, 0, mapping);
+ checkReverseMapping(3, 1, "example.js", 1, mapping);
+ next();
}
]);
};
Modified: trunk/Source/WebCore/ChangeLog (98344 => 98345)
--- trunk/Source/WebCore/ChangeLog 2011-10-25 14:24:59 UTC (rev 98344)
+++ trunk/Source/WebCore/ChangeLog 2011-10-25 14:26:59 UTC (rev 98345)
@@ -1,3 +1,13 @@
+2011-10-24 Pavel Podivilov <podivi...@chromium.org>
+
+ Web Inspector: fix empty line handling in source maps.
+ https://bugs.webkit.org/show_bug.cgi?id=70726
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/front-end/CompilerSourceMapping.js:
+ (WebInspector.ClosureCompilerSourceMapping.prototype._parseMappings):
+
2011-10-25 Justin Schuh <jsc...@chromium.org>
Check for empty string in parseArcFlag
Modified: trunk/Source/WebCore/inspector/front-end/CompilerSourceMapping.js (98344 => 98345)
--- trunk/Source/WebCore/inspector/front-end/CompilerSourceMapping.js 2011-10-25 14:24:59 UTC (rev 98344)
+++ trunk/Source/WebCore/inspector/front-end/CompilerSourceMapping.js 2011-10-25 14:26:59 UTC (rev 98345)
@@ -151,7 +151,19 @@
var sourceURL = this._sources[0];
var reverseMappings = this._reverseMappingsBySourceURL[sourceURL];
- do {
+ while (true) {
+ if (stringCharIterator.peek() === ",")
+ stringCharIterator.next();
+ else {
+ while (stringCharIterator.peek() === ";") {
+ lineNumber += 1;
+ columnNumber = 0;
+ stringCharIterator.next();
+ }
+ if (!stringCharIterator.hasNext())
+ break;
+ }
+
columnNumber += this._decodeVLQ(stringCharIterator);
if (!this._isSeparator(stringCharIterator.peek())) {
var sourceIndexDelta = this._decodeVLQ(stringCharIterator);
@@ -169,12 +181,7 @@
if (!reverseMappings[sourceLineNumber])
reverseMappings[sourceLineNumber] = [lineNumber, columnNumber];
}
-
- if (stringCharIterator.next() === ";") {
- lineNumber += 1;
- columnNumber = 0;
- }
- } while(stringCharIterator.hasNext());
+ }
},
_isSeparator: function(char)