| 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 | 4 |
| 5 WebInspector.SourceMapNamesResolver = {}; | 5 WebInspector.SourceMapNamesResolver = {}; |
| 6 | 6 |
| 7 WebInspector.SourceMapNamesResolver._cachedMapSymbol = Symbol("cache"); | 7 WebInspector.SourceMapNamesResolver._cachedMapSymbol = Symbol("cache"); |
| 8 WebInspector.SourceMapNamesResolver._cachedPromiseSymbol = Symbol("cachePromise"
); | 8 WebInspector.SourceMapNamesResolver._cachedPromiseSymbol = Symbol("cachePromise"
); |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 */ | 42 */ |
| 43 function onContent(content) | 43 function onContent(content) |
| 44 { | 44 { |
| 45 if (!content) | 45 if (!content) |
| 46 return new Map(); | 46 return new Map(); |
| 47 | 47 |
| 48 var startLocation = scope.startLocation(); | 48 var startLocation = scope.startLocation(); |
| 49 var endLocation = scope.endLocation(); | 49 var endLocation = scope.endLocation(); |
| 50 var textRange = new WebInspector.TextRange(startLocation.lineNumber, sta
rtLocation.columnNumber, endLocation.lineNumber, endLocation.columnNumber); | 50 var textRange = new WebInspector.TextRange(startLocation.lineNumber, sta
rtLocation.columnNumber, endLocation.lineNumber, endLocation.columnNumber); |
| 51 | 51 |
| 52 var scopeText = textRange.extract(content); | 52 var text = new WebInspector.Text(content); |
| 53 var scopeStart = textRange.toSourceRange(content).offset; | 53 var scopeText = text.extract(textRange); |
| 54 var scopeStart = text.toSourceRange(textRange).offset; |
| 54 var prefix = "function fui"; | 55 var prefix = "function fui"; |
| 55 var root = acorn.parse(prefix + scopeText, {}); | 56 var root = acorn.parse(prefix + scopeText, {}); |
| 56 /** @type {!Array<!ESTree.Node>} */ | 57 /** @type {!Array<!ESTree.Node>} */ |
| 57 var identifiers = []; | 58 var identifiers = []; |
| 58 var functionDeclarationCounter = 0; | 59 var functionDeclarationCounter = 0; |
| 59 var walker = new WebInspector.ESTreeWalker(beforeVisit, afterVisit); | 60 var walker = new WebInspector.ESTreeWalker(beforeVisit, afterVisit); |
| 60 | 61 |
| 61 /** | 62 /** |
| 62 * @param {!ESTree.Node} node | 63 * @param {!ESTree.Node} node |
| 63 * @return {boolean} | 64 * @return {boolean} |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 206 |
| 206 /** | 207 /** |
| 207 * @param {?string} content | 208 * @param {?string} content |
| 208 * @return {string} | 209 * @return {string} |
| 209 */ | 210 */ |
| 210 function onContent(content) | 211 function onContent(content) |
| 211 { | 212 { |
| 212 if (!content) | 213 if (!content) |
| 213 return ""; | 214 return ""; |
| 214 | 215 |
| 216 var text = new WebInspector.Text(content); |
| 215 var textRange = sourceMap.reverseMapTextRange(uiSourceCode.url(), new We
bInspector.TextRange(lineNumber, startColumnNumber, lineNumber, endColumnNumber)
); | 217 var textRange = sourceMap.reverseMapTextRange(uiSourceCode.url(), new We
bInspector.TextRange(lineNumber, startColumnNumber, lineNumber, endColumnNumber)
); |
| 216 var originalText = textRange.extract(content); | 218 var originalText = text.extract(textRange); |
| 217 if (!originalText) | 219 if (!originalText) |
| 218 return ""; | 220 return ""; |
| 219 | 221 |
| 220 var tokenizer = acorn.tokenizer(originalText, {ecmaVersion: 6}); | 222 var tokenizer = acorn.tokenizer(originalText, {ecmaVersion: 6}); |
| 221 try { | 223 try { |
| 222 var token = tokenizer.getToken(); | 224 var token = tokenizer.getToken(); |
| 223 while (token.type !== acorn.tokTypes.eof && WebInspector.AcornTokeni
zer.punctuator(token)) | 225 while (token.type !== acorn.tokTypes.eof && WebInspector.AcornTokeni
zer.punctuator(token)) |
| 224 token = tokenizer.getToken(); | 226 token = tokenizer.getToken(); |
| 225 | 227 |
| 226 var startIndex = token.start; | 228 var startIndex = token.start; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 * @override | 512 * @override |
| 511 * @param {function(?Array<!DebuggerAgent.CollectionEntry>)} callback | 513 * @param {function(?Array<!DebuggerAgent.CollectionEntry>)} callback |
| 512 */ | 514 */ |
| 513 collectionEntries: function(callback) | 515 collectionEntries: function(callback) |
| 514 { | 516 { |
| 515 this._object.collectionEntries(callback); | 517 this._object.collectionEntries(callback); |
| 516 }, | 518 }, |
| 517 | 519 |
| 518 __proto__: WebInspector.RemoteObject.prototype | 520 __proto__: WebInspector.RemoteObject.prototype |
| 519 } | 521 } |
| OLD | NEW |