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

Unified Diff: third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js

Issue 2450663004: DevTools: do not allow using 'this' before call into super. (Closed)
Patch Set: rebaselined 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
Index: third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
index 57fe30a934b249384b01aab8259953bab35cf143..0a75cb7ed41c56c956da30d8e3cc3827c56af974 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/SourceFrame.js
@@ -49,7 +49,6 @@ WebInspector.SourceFrame = function(url, lazyContent)
this._currentSearchResultIndex = -1;
this._searchResults = [];
- this._textEditor.setReadOnly(!this.canEditSource());
this._textEditor.addEventListener(WebInspector.SourcesTextEditor.Events.EditorFocused, this._resetCurrentSearchResultIndex, this);
this._textEditor.addEventListener(WebInspector.SourcesTextEditor.Events.SelectionChanged, this._updateSourcePosition, this);
this._textEditor.addEventListener(WebInspector.SourcesTextEditor.Events.TextChanged, event => this.onTextChanged(event.data.oldRange, event.data.newRange));
@@ -63,10 +62,20 @@ WebInspector.SourceFrame = function(url, lazyContent)
* @type {?WebInspector.SearchableView}
*/
this._searchableView = null;
+ this._editable = false;
};
WebInspector.SourceFrame.prototype = {
/**
+ * @param {boolean} editable
+ */
+ setEditable: function(editable)
+ {
+ this._editable = editable;
+ this._textEditor.setReadOnly(editable);
+ },
+
+ /**
* @param {number} key
* @param {function():boolean} handler
*/
@@ -568,7 +577,7 @@ WebInspector.SourceFrame.prototype = {
*/
canEditSource: function()
{
- return false;
+ return this._editable;
},
_updateSourcePosition: function()

Powered by Google App Engine
This is Rietveld 408576698