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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 2450663004: DevTools: do not allow using 'this' before call into super. (Closed)
Patch Set: 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/ui/TextPrompt.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
index 8aa4cc24b78023195d7216596178462f10e88565..9f216cf6d49401bcee6b7169800423947e3fbc4b 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
@@ -31,18 +31,14 @@
* @constructor
* @extends {WebInspector.Object}
* @implements {WebInspector.SuggestBoxDelegate}
- * @param {function(!Element, !Range, boolean, function(!Array.<string>, number=))} completions
- * @param {string=} stopCharacters
*/
-WebInspector.TextPrompt = function(completions, stopCharacters)
+WebInspector.TextPrompt = function()
{
/**
* @type {!Element|undefined}
*/
this._proxyElement;
this._proxyElementDisplay = "inline-block";
- this._loadCompletions = completions;
- this._completionStopCharacters = stopCharacters || " =:[({;,!+-*/&|^<>.";
this._autocompletionTimeout = WebInspector.TextPrompt.DefaultAutocompletionTimeout;
this._title = "";
this._previousText = "";
@@ -60,6 +56,16 @@ WebInspector.TextPrompt.Events = {
WebInspector.TextPrompt.prototype = {
/**
+ * @param {function(!Element, !Range, boolean, function(!Array.<string>, number=))} completions
+ * @param {string=} stopCharacters
+ */
+ initialize: function(completions, stopCharacters)
+ {
+ this._loadCompletions = completions;
+ this._completionStopCharacters = stopCharacters || " =:[({;,!+-*/&|^<>.";
+ },
+
+ /**
* @param {number} timeout
*/
setAutocompletionTimeout: function(timeout)
@@ -796,7 +802,8 @@ WebInspector.TextPrompt.prototype = {
*/
WebInspector.TextPromptWithHistory = function(completions, stopCharacters)
{
- WebInspector.TextPrompt.call(this, completions, stopCharacters);
+ WebInspector.TextPrompt.call(this);
+ this.initialize(completions, stopCharacters);
this._history = new WebInspector.HistoryManager();
this._addCompletionsFromHistory = true;

Powered by Google App Engine
This is Rietveld 408576698