| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 /** | 58 /** |
| 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 {!Array<!{name: string, offset: number}>} identifiers | 62 * @param {!Array<!{name: string, offset: number}>} identifiers |
| 63 * @return {!Array<!Sources.SourceMapNamesResolver.Identifier>} | 63 * @return {!Array<!Sources.SourceMapNamesResolver.Identifier>} |
| 64 */ | 64 */ |
| 65 function onIdentifiers(text, scopeStart, prefix, identifiers) { | 65 function onIdentifiers(text, scopeStart, prefix, identifiers) { |
| 66 var result = []; | 66 var result = []; |
| 67 var cursor = new Common.TextCursor(text.lineEndings()); | 67 var cursor = new Common.TextCursor(text.lineEndings()); |
| 68 var promises = []; | |
| 69 for (var i = 0; i < identifiers.length; ++i) { | 68 for (var i = 0; i < identifiers.length; ++i) { |
| 70 var id = identifiers[i]; | 69 var id = identifiers[i]; |
| 71 if (id.offset < prefix.length) | 70 if (id.offset < prefix.length) |
| 72 continue; | 71 continue; |
| 73 var start = scopeStart + id.offset - prefix.length; | 72 var start = scopeStart + id.offset - prefix.length; |
| 74 cursor.resetTo(start); | 73 cursor.resetTo(start); |
| 75 result.push(new Sources.SourceMapNamesResolver.Identifier(id.name, cursor.
lineNumber(), cursor.columnNumber())); | 74 result.push(new Sources.SourceMapNamesResolver.Identifier(id.name, cursor.
lineNumber(), cursor.columnNumber())); |
| 76 } | 75 } |
| 77 return result; | 76 return result; |
| 78 } | 77 } |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 531 } |
| 533 | 532 |
| 534 /** | 533 /** |
| 535 * @override | 534 * @override |
| 536 * @return {boolean} | 535 * @return {boolean} |
| 537 */ | 536 */ |
| 538 isNode() { | 537 isNode() { |
| 539 return this._object.isNode(); | 538 return this._object.isNode(); |
| 540 } | 539 } |
| 541 }; | 540 }; |
| OLD | NEW |