| Index: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| index 4013efa2e1199fc65b60a2dbc35cd042f6941300..291d0d908ed5ebe5ff81b2af8d62ed033bf7141a 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
|
| @@ -45,6 +45,7 @@ WebInspector.RuntimeModel = function(target)
|
| * @type {!Object.<number, !WebInspector.ExecutionContext>}
|
| */
|
| this._executionContextById = {};
|
| + this._executionContextComparator = WebInspector.ExecutionContext.comparator;
|
|
|
| if (WebInspector.moduleSetting("customFormatters").get())
|
| this._agent.setCustomObjectFormatterEnabled(true);
|
| @@ -67,7 +68,23 @@ WebInspector.RuntimeModel.prototype = {
|
| */
|
| executionContexts: function()
|
| {
|
| - return Object.values(this._executionContextById);
|
| + return Object.values(this._executionContextById).sort(this.executionContextComparator());
|
| + },
|
| +
|
| + /**
|
| + * @param {function(!WebInspector.ExecutionContext,!WebInspector.ExecutionContext)} comparator
|
| + */
|
| + setExecutionContextComparator: function(comparator)
|
| + {
|
| + this._executionContextComparator = comparator;
|
| + },
|
| +
|
| + /**
|
| + * @return {function(!WebInspector.ExecutionContext,!WebInspector.ExecutionContext)} comparator
|
| + */
|
| + executionContextComparator: function()
|
| + {
|
| + return this._executionContextComparator;
|
| },
|
|
|
| /**
|
| @@ -453,10 +470,6 @@ WebInspector.ExecutionContext.comparator = function(a, b)
|
| if (weightDiff)
|
| return -weightDiff;
|
|
|
| - var frameIdDiff = String.hashCode(a.frameId) - String.hashCode(b.frameId);
|
| - if (frameIdDiff)
|
| - return frameIdDiff;
|
| -
|
| // Main world context should always go first.
|
| if (a.isDefault)
|
| return -1;
|
| @@ -869,11 +882,11 @@ WebInspector.EventListener.prototype = {
|
| if (!this._removeFunction)
|
| return Promise.resolve();
|
| return this._removeFunction.callFunctionPromise(callCustomRemove, [
|
| - WebInspector.RemoteObject.toCallArgument(this._type),
|
| - WebInspector.RemoteObject.toCallArgument(this._originalHandler),
|
| - WebInspector.RemoteObject.toCallArgument(this._useCapture),
|
| - WebInspector.RemoteObject.toCallArgument(this._passive),
|
| - ]).then(() => undefined);
|
| + WebInspector.RemoteObject.toCallArgument(this._type),
|
| + WebInspector.RemoteObject.toCallArgument(this._originalHandler),
|
| + WebInspector.RemoteObject.toCallArgument(this._useCapture),
|
| + WebInspector.RemoteObject.toCallArgument(this._passive),
|
| + ]).then(() => undefined);
|
|
|
| /**
|
| * @param {string} type
|
|
|