Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| index 5766476fc02776a9a69c92afa5b7286265cbd01c..625c589bfb43df93a6335a446ef004465bdd4c3e 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
| @@ -712,6 +712,7 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
| /** @type {!Map.<number, !Set<string>>} */ |
| var namesPerLine = new Map(); |
| + var skipNextToken = false; |
|
lushnikov
2016/10/04 23:31:31
let's name this skipObjectProperty so that reader
kozy
2016/10/05 00:10:22
Done.
|
| var tokenizer = new WebInspector.CodeMirrorUtils.TokenizerFactory().createTokenizer("text/javascript"); |
| tokenizer(this.textEditor.line(fromLine).substring(fromColumn), processToken.bind(this, fromLine)); |
| for (var i = fromLine + 1; i < toLine; ++i) |
| @@ -727,7 +728,7 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
| */ |
| function processToken(lineNumber, tokenValue, tokenType, column, newColumn) |
| { |
| - if (tokenType && this._isIdentifier(tokenType) && valuesMap.get(tokenValue)) { |
| + if (!skipNextToken && tokenType && this._isIdentifier(tokenType) && valuesMap.get(tokenValue)) { |
| var names = namesPerLine.get(lineNumber); |
| if (!names) { |
| names = new Set(); |
| @@ -735,6 +736,7 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
| } |
| names.add(tokenValue); |
| } |
| + skipNextToken = tokenValue === "."; |
| } |
| this.textEditor.operation(this._renderDecorations.bind(this, valuesMap, namesPerLine, fromLine, toLine)); |
| }, |