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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 this._clearValueWidgets(); 705 this._clearValueWidgets();
706 return; 706 return;
707 } 707 }
708 708
709 var valuesMap = new Map(); 709 var valuesMap = new Map();
710 for (var property of properties) 710 for (var property of properties)
711 valuesMap.set(property.name, property.value); 711 valuesMap.set(property.name, property.value);
712 712
713 /** @type {!Map.<number, !Set<string>>} */ 713 /** @type {!Map.<number, !Set<string>>} */
714 var namesPerLine = new Map(); 714 var namesPerLine = new Map();
715 var skipObjectProperty = false;
715 var tokenizer = new WebInspector.CodeMirrorUtils.TokenizerFactory().crea teTokenizer("text/javascript"); 716 var tokenizer = new WebInspector.CodeMirrorUtils.TokenizerFactory().crea teTokenizer("text/javascript");
716 tokenizer(this.textEditor.line(fromLine).substring(fromColumn), processT oken.bind(this, fromLine)); 717 tokenizer(this.textEditor.line(fromLine).substring(fromColumn), processT oken.bind(this, fromLine));
717 for (var i = fromLine + 1; i < toLine; ++i) 718 for (var i = fromLine + 1; i < toLine; ++i)
718 tokenizer(this.textEditor.line(i), processToken.bind(this, i)); 719 tokenizer(this.textEditor.line(i), processToken.bind(this, i));
719 720
720 /** 721 /**
721 * @param {number} lineNumber 722 * @param {number} lineNumber
722 * @param {string} tokenValue 723 * @param {string} tokenValue
723 * @param {?string} tokenType 724 * @param {?string} tokenType
724 * @param {number} column 725 * @param {number} column
725 * @param {number} newColumn 726 * @param {number} newColumn
726 * @this {WebInspector.JavaScriptSourceFrame} 727 * @this {WebInspector.JavaScriptSourceFrame}
727 */ 728 */
728 function processToken(lineNumber, tokenValue, tokenType, column, newColu mn) 729 function processToken(lineNumber, tokenValue, tokenType, column, newColu mn)
729 { 730 {
730 if (tokenType && this._isIdentifier(tokenType) && valuesMap.get(toke nValue)) { 731 if (!skipObjectProperty && tokenType && this._isIdentifier(tokenType ) && valuesMap.get(tokenValue)) {
731 var names = namesPerLine.get(lineNumber); 732 var names = namesPerLine.get(lineNumber);
732 if (!names) { 733 if (!names) {
733 names = new Set(); 734 names = new Set();
734 namesPerLine.set(lineNumber, names); 735 namesPerLine.set(lineNumber, names);
735 } 736 }
736 names.add(tokenValue); 737 names.add(tokenValue);
737 } 738 }
739 skipObjectProperty = tokenValue === ".";
738 } 740 }
739 this.textEditor.operation(this._renderDecorations.bind(this, valuesMap, namesPerLine, fromLine, toLine)); 741 this.textEditor.operation(this._renderDecorations.bind(this, valuesMap, namesPerLine, fromLine, toLine));
740 }, 742 },
741 743
742 /** 744 /**
743 * @param {!Map.<string,!WebInspector.RemoteObject>} valuesMap 745 * @param {!Map.<string,!WebInspector.RemoteObject>} valuesMap
744 * @param {!Map.<number, !Set<string>>} namesPerLine 746 * @param {!Map.<number, !Set<string>>} namesPerLine
745 * @param {number} fromLine 747 * @param {number} fromLine
746 * @param {number} toLine 748 * @param {number} toLine
747 */ 749 */
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this); 1069 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyChanged, this._workingCopyChanged, this);
1068 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this); 1070 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .WorkingCopyCommitted, this._workingCopyCommitted, this);
1069 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this); 1071 this.uiSourceCode().removeEventListener(WebInspector.UISourceCode.Events .TitleChanged, this._showBlackboxInfobarIfNeeded, this);
1070 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this); 1072 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene r(this._showBlackboxInfobarIfNeeded, this);
1071 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this); 1073 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th is._showBlackboxInfobarIfNeeded, this);
1072 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 1074 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
1073 }, 1075 },
1074 1076
1075 __proto__: WebInspector.UISourceCodeFrame.prototype 1077 __proto__: WebInspector.UISourceCodeFrame.prototype
1076 } 1078 }
OLDNEW
« 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