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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 2388903004: [DevTools] Fixed inline scope variables for object property (Closed)
Patch Set: addressed comments Created 4 years, 2 months 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
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2bc396e53fdf6783b96678a375327bf12fb154e3 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 skipObjectProperty = false;
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 (!skipObjectProperty && 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);
}
+ skipObjectProperty = tokenValue === ".";
}
this.textEditor.operation(this._renderDecorations.bind(this, valuesMap, namesPerLine, fromLine, toLine));
},
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/inline-scope-variables-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698