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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js

Issue 2560043005: DevTools: Remove unused variables. Disallow unused variables with eslint (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 Sources.SourceMapNamesResolver = {}; 4 Sources.SourceMapNamesResolver = {};
5 5
6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache'); 6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache');
7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi ers'); 7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi ers');
8 8
9 /** 9 /**
10 * @unrestricted 10 * @unrestricted
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 * @param {!Common.Text} text 59 * @param {!Common.Text} text
60 * @param {number} scopeStart 60 * @param {number} scopeStart
61 * @param {string} prefix 61 * @param {string} prefix
62 * @param {?MessageEvent} event 62 * @param {?MessageEvent} event
63 * @return {!Array<!Sources.SourceMapNamesResolver.Identifier>} 63 * @return {!Array<!Sources.SourceMapNamesResolver.Identifier>}
64 */ 64 */
65 function onIdentifiers(text, scopeStart, prefix, event) { 65 function onIdentifiers(text, scopeStart, prefix, event) {
66 var identifiers = event ? /** @type {!Array<!{name: string, offset: number}> } */ (event.data) : []; 66 var identifiers = event ? /** @type {!Array<!{name: string, offset: number}> } */ (event.data) : [];
67 var result = []; 67 var result = [];
68 var cursor = new Common.TextCursor(text.lineEndings()); 68 var cursor = new Common.TextCursor(text.lineEndings());
69 var promises = [];
70 for (var i = 0; i < identifiers.length; ++i) { 69 for (var i = 0; i < identifiers.length; ++i) {
71 var id = identifiers[i]; 70 var id = identifiers[i];
72 if (id.offset < prefix.length) 71 if (id.offset < prefix.length)
73 continue; 72 continue;
74 var start = scopeStart + id.offset - prefix.length; 73 var start = scopeStart + id.offset - prefix.length;
75 cursor.resetTo(start); 74 cursor.resetTo(start);
76 result.push(new Sources.SourceMapNamesResolver.Identifier(id.name, cursor. lineNumber(), cursor.columnNumber())); 75 result.push(new Sources.SourceMapNamesResolver.Identifier(id.name, cursor. lineNumber(), cursor.columnNumber()));
77 } 76 }
78 return result; 77 return result;
79 } 78 }
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 540 }
542 541
543 /** 542 /**
544 * @override 543 * @override
545 * @return {boolean} 544 * @return {boolean}
546 */ 545 */
547 isNode() { 546 isNode() {
548 return this._object.isNode(); 547 return this._object.isNode();
549 } 548 }
550 }; 549 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698