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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: Created 4 years, 1 month 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: third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
index 598a8a3fa96359827960c5f5f2a2eedbaf401ea9..c0ce23946dcca737bc9f10c9cd37853687f91407 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
@@ -171,11 +171,11 @@ WebInspector.SourceMapFactory.prototype = {
*/
WebInspector.TextSourceMap = function(compiledURL, sourceMappingURL, payload)
{
- if (!WebInspector.TextSourceMap.prototype._base64Map) {
+ if (!WebInspector.TextSourceMap._base64Map) {
const base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- WebInspector.TextSourceMap.prototype._base64Map = {};
+ WebInspector.TextSourceMap._base64Map = {};
for (var i = 0; i < base64Digits.length; ++i)
- WebInspector.TextSourceMap.prototype._base64Map[base64Digits.charAt(i)] = i;
+ WebInspector.TextSourceMap._base64Map[base64Digits.charAt(i)] = i;
}
this._json = payload;
@@ -188,6 +188,10 @@ WebInspector.TextSourceMap = function(compiledURL, sourceMappingURL, payload)
this._eachSection(this._parseSources.bind(this));
};
+WebInspector.TextSourceMap._VLQ_BASE_SHIFT = 5;
+WebInspector.TextSourceMap._VLQ_BASE_MASK = (1 << 5) - 1;
+WebInspector.TextSourceMap._VLQ_CONTINUATION_MASK = 1 << 5;
+
/**
* @param {string} sourceMapURL
* @param {string} compiledURL
@@ -503,10 +507,10 @@ WebInspector.TextSourceMap.prototype = {
var result = 0;
var shift = 0;
do {
- var digit = this._base64Map[stringCharIterator.next()];
- result += (digit & this._VLQ_BASE_MASK) << shift;
- shift += this._VLQ_BASE_SHIFT;
- } while (digit & this._VLQ_CONTINUATION_MASK);
+ var digit = WebInspector.TextSourceMap._base64Map[stringCharIterator.next()];
+ result += (digit & WebInspector.TextSourceMap._VLQ_BASE_MASK) << shift;
+ shift += WebInspector.TextSourceMap._VLQ_BASE_SHIFT;
+ } while (digit & WebInspector.TextSourceMap._VLQ_CONTINUATION_MASK);
// Fix the sign.
var negative = result & 1;
@@ -541,11 +545,7 @@ WebInspector.TextSourceMap.prototype = {
var startMapping = mappings[startIndex];
var endMapping = mappings[endIndex];
return new WebInspector.TextRange(startMapping.lineNumber, startMapping.columnNumber, endMapping.lineNumber, endMapping.columnNumber);
- },
-
- _VLQ_BASE_SHIFT: 5,
- _VLQ_BASE_MASK: (1 << 5) - 1,
- _VLQ_CONTINUATION_MASK: 1 << 5
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698