Title: [201855] trunk
Revision
201855
Author
[email protected]
Date
2016-06-08 23:20:55 -0700 (Wed, 08 Jun 2016)

Log Message

REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console
https://bugs.webkit.org/show_bug.cgi?id=158548
<rdar://problem/26708513>

Patch by Joseph Pecoraro <[email protected]> on 2016-06-08
Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Controllers/RuntimeManager.js:
(WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
Switch the many parameters to an options dictionary.
Include a new option for sourceURL appender, so that
Console evaluations can have its own append.

* UserInterface/Controllers/_javascript_LogViewController.js:
(WebInspector._javascript_LogViewController.prototype.consolePromptTextCommitted):
Use the appendWebInspectorConsoleEvaluationSourceURL appender.

* UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js:
(WebInspector._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection.):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
Use the new options dictionary.

LayoutTests:

* inspector/console/addInspectedNode.html:
* inspector/console/command-line-api-copy.html:
* inspector/console/command-line-api.html:
* inspector/console/console-api.html:
* inspector/console/console-table.html:
* inspector/console/messagesCleared.html:
* inspector/controller/runtime-controller.html:
* inspector/debugger/command-line-api-exception-nested-catch.html:
* inspector/debugger/command-line-api-exception.html:
* inspector/model/remote-object-get-properties.html:
* inspector/model/remote-object-weak-collection.html:
* inspector/model/remote-object.html:
* inspector/timeline/exception-in-injected-script-while-recording.html:
Update evaluateInInspectedWindow callsites to use options dictionary.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (201854 => 201855)


--- trunk/LayoutTests/ChangeLog	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/ChangeLog	2016-06-09 06:20:55 UTC (rev 201855)
@@ -1,3 +1,26 @@
+2016-06-08  Joseph Pecoraro  <[email protected]>
+
+        REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console
+        https://bugs.webkit.org/show_bug.cgi?id=158548
+        <rdar://problem/26708513>
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/console/addInspectedNode.html:
+        * inspector/console/command-line-api-copy.html:
+        * inspector/console/command-line-api.html:
+        * inspector/console/console-api.html:
+        * inspector/console/console-table.html:
+        * inspector/console/messagesCleared.html:
+        * inspector/controller/runtime-controller.html:
+        * inspector/debugger/command-line-api-exception-nested-catch.html:
+        * inspector/debugger/command-line-api-exception.html:
+        * inspector/model/remote-object-get-properties.html:
+        * inspector/model/remote-object-weak-collection.html:
+        * inspector/model/remote-object.html:
+        * inspector/timeline/exception-in-injected-script-while-recording.html:
+        Update evaluateInInspectedWindow callsites to use options dictionary.
+
 2016-06-08  Chris Dumez  <[email protected]>
 
         DedicatedWorkerGlobalScope prototype chain is incorrect

Modified: trunk/LayoutTests/inspector/console/addInspectedNode.html (201854 => 201855)


--- trunk/LayoutTests/inspector/console/addInspectedNode.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/console/addInspectedNode.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -6,13 +6,7 @@
 function test()
 {
     function evaluate$0(callback) {
-        const objectGroup = "test";
-        const includeCommandLineAPI = true;
-        const ignorePauseOnExceptionsAndMute = false;
-        const shouldReturnByValue = false;
-        const shouldGeneratePreview = false;
-        const shouldSaveResult = false;
-        WebInspector.runtimeManager.evaluateInInspectedWindow("$0", objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, callback);
+        WebInspector.runtimeManager.evaluateInInspectedWindow("$0", {objectGroup: "test", includeCommandLineAPI: true}, callback);
     }
 
     let nodeA, nodeB;

Modified: trunk/LayoutTests/inspector/console/command-line-api-copy.html (201854 => 201855)


--- trunk/LayoutTests/inspector/console/command-line-api-copy.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/console/command-line-api-copy.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -22,14 +22,8 @@
     }
 
     function commandLineAPICopyAndPaste(_expression_, callback) {
-        const objectGroup = "test";
-        const includeCommandLineAPI = true;
-        const ignorePauseOnExceptionsAndMute = false;
-        const shouldReturnByValue = false;
-        const shouldGeneratePreview = false;
-        const shouldSaveResult = false;
         InspectorTest.assert(typeof _expression_ === "string", "Test requires string _expression_ to evaluate on the page.");
-        WebInspector.runtimeManager.evaluateInInspectedWindow(`copy(${_expression_})`, objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, () => {
+        WebInspector.runtimeManager.evaluateInInspectedWindow(`copy(${_expression_})`, {objectGroup: "test", includeCommandLineAPI: true}, () => {
             InspectorTest.evaluateInPage("pasteAndReturnString()", (error, remoteObjectPayload) => {
                 let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload);
                 InspectorTest.assert(remoteObject.type === "string", "RemoteObject from pasteAndReturnString should return a string.");

Modified: trunk/LayoutTests/inspector/console/command-line-api.html (201854 => 201855)


--- trunk/LayoutTests/inspector/console/command-line-api.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/console/command-line-api.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -69,13 +69,7 @@
                         reject();
                 }
 
-                const objectGroup = "test";
-                const includeCommandLineAPI = true;
-                const ignorePauseOnExceptionsAndMute = false;
-                const shouldReturnByValue = false;
-                const shouldGeneratePreview = false;
-                const shouldSaveResult = false;
-                WebInspector.runtimeManager.evaluateInInspectedWindow(`String(${input})`, objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, callback);
+                WebInspector.runtimeManager.evaluateInInspectedWindow(`String(${input})`, {objectGroup: "test", includeCommandLineAPI: true}, callback);
             }
         })
     }

Modified: trunk/LayoutTests/inspector/console/console-api.html (201854 => 201855)


--- trunk/LayoutTests/inspector/console/console-api.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/console/console-api.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -66,7 +66,7 @@
     });
 
     for (var step of steps)
-        WebInspector.runtimeManager.evaluateInInspectedWindow(step, "test", false, true, false, true, false, function(){});
+        WebInspector.runtimeManager.evaluateInInspectedWindow(step, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(){});
 }
 </script>
 </head>

Modified: trunk/LayoutTests/inspector/console/console-table.html (201854 => 201855)


--- trunk/LayoutTests/inspector/console/console-table.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/console/console-table.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -44,7 +44,7 @@
     });
 
     for (var step of steps)
-        WebInspector.runtimeManager.evaluateInInspectedWindow(step, "test", false, true, false, true, false, function(){});
+        WebInspector.runtimeManager.evaluateInInspectedWindow(step, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(){});
 }
 </script>
 </head>

Modified: trunk/LayoutTests/inspector/console/messagesCleared.html (201854 => 201855)


--- trunk/LayoutTests/inspector/console/messagesCleared.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/console/messagesCleared.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -35,13 +35,7 @@
         name: "ClearViaCommandLineAPI",
         description: "Calling `clear()` in the command line API should trigger Console.messagesCleared.",
         test: (resolve, reject) => {
-            const objectGroup = "test";
-            const includeCommandLineAPI = true;
-            const ignorePauseOnExceptionsAndMute = false;
-            const shouldReturnByValue = false;
-            const shouldGeneratePreview = false;
-            const shouldSaveResult = false;
-            WebInspector.runtimeManager.evaluateInInspectedWindow("clear()", objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, function(){});
+            WebInspector.runtimeManager.evaluateInInspectedWindow("clear()", {objectGroup: "test", includeCommandLineAPI: true}, function(){});
             WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.Cleared, (event) => {
                 InspectorTest.expectThat(event, "Cleared event should fire.");
                 resolve();

Modified: trunk/LayoutTests/inspector/controller/runtime-controller.html (201854 => 201855)


--- trunk/LayoutTests/inspector/controller/runtime-controller.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/controller/runtime-controller.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -12,13 +12,7 @@
         description: "Test evaluating an object literal string conveniently converts wraps it in parenthesis to avoid misinterpretation as a program with a block and labeled statement.",
         test: (resolve, reject) => {
             function testSource(_expression_, callback) {
-                const objectGroup = "test";
-                const includeCommandLineAPI = false;
-                const ignorePauseOnExceptionsAndMute = false;
-                const shouldReturnByValue = false;
-                const shouldGeneratePreview = false;
-                const shouldSaveResult = false;
-                WebInspector.runtimeManager.evaluateInInspectedWindow(_expression_, objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, (result, wasThrown) => {
+                WebInspector.runtimeManager.evaluateInInspectedWindow(_expression_, {objectGroup: "test"}, (result, wasThrown) => {
                     InspectorTest.log("Source: " + _expression_);
                     callback(result, wasThrown);
                 });

Modified: trunk/LayoutTests/inspector/debugger/command-line-api-exception-nested-catch.html (201854 => 201855)


--- trunk/LayoutTests/inspector/debugger/command-line-api-exception-nested-catch.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/debugger/command-line-api-exception-nested-catch.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -16,13 +16,13 @@
     WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
 
     function dumpCommandLineAPIValue(prefix) {
-        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", "test", true, true, false, false, false, function(result, wasThrown) {
+        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) {
             InspectorTest.log(prefix + ": $exception => " + result.description);
         });
     }
 
     function checkIfExceptionValueMatchesVariable(varName) {
-        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === " + varName, "test", true, true, false, false, false, function(result, wasThrown) {
+        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === " + varName, {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) {
             InspectorTest.log("  CATCH: $exception === " + varName + " ? " + result.description);
         });
     }

Modified: trunk/LayoutTests/inspector/debugger/command-line-api-exception.html (201854 => 201855)


--- trunk/LayoutTests/inspector/debugger/command-line-api-exception.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/debugger/command-line-api-exception.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -40,13 +40,13 @@
     }
 
     function dumpCommandLineAPIValue(prefix) {
-        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", "test", true, true, false, false, false, function(result, wasThrown) {
+        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) {
             InspectorTest.log(prefix + ": $exception => " + result.description);
         });
     }
 
     function checkIfExceptionValueMatchesCatchVariable() {
-        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === e", "test", true, true, false, false, false, function(result, wasThrown) {
+        WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === e", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) {
             InspectorTest.log("STEPPED OUT TO CATCH BLOCK: $exception === e ? " + result.description);
         });
     }

Modified: trunk/LayoutTests/inspector/model/remote-object-get-properties.html (201854 => 201855)


--- trunk/LayoutTests/inspector/model/remote-object-get-properties.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/model/remote-object-get-properties.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -75,7 +75,7 @@
         InspectorTest.log("-----------------------------------------------------");
         InspectorTest.log("_expression_: " + step._expression_);
 
-        WebInspector.runtimeManager.evaluateInInspectedWindow(step._expression_, "test", false, true, false, false, false, function(remoteObject, wasThrown) {
+        WebInspector.runtimeManager.evaluateInInspectedWindow(step._expression_, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true}, function(remoteObject, wasThrown) {
             InspectorTest.assert(remoteObject instanceof WebInspector.RemoteObject);
             InspectorTest.log("type: " + remoteObject.type);
             if (remoteObject.subtype)

Modified: trunk/LayoutTests/inspector/model/remote-object-weak-collection.html (201854 => 201855)


--- trunk/LayoutTests/inspector/model/remote-object-weak-collection.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/model/remote-object-weak-collection.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -53,8 +53,8 @@
 
         // Run the _expression_, and then run a garbage collection on a different
         // event loop so no objects are kept alive by the stack.
-        WebInspector.runtimeManager.evaluateInInspectedWindow(step._expression_, "test", false, true, false, true, false, function(remoteObject, wasThrown) {
-            WebInspector.runtimeManager.evaluateInInspectedWindow("GCController.collect()", "test", false, true, false, false, false, function() {
+        WebInspector.runtimeManager.evaluateInInspectedWindow(step._expression_, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(remoteObject, wasThrown) {
+            WebInspector.runtimeManager.evaluateInInspectedWindow("GCController.collect()", {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true}, function() {
                 InspectorTest.assert(remoteObject instanceof WebInspector.RemoteObject);
                 remoteObject.getCollectionEntries(0, 100, function(entries) {
                     InspectorTest.log("ENTRIES:");

Modified: trunk/LayoutTests/inspector/model/remote-object.html (201854 => 201855)


--- trunk/LayoutTests/inspector/model/remote-object.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/model/remote-object.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -215,7 +215,7 @@
                 return;
             }
 
-            WebInspector.runtimeManager.evaluateInInspectedWindow(step._expression_, "test", false, true, false, true, false, function(remoteObject, wasThrown) {
+            WebInspector.runtimeManager.evaluateInInspectedWindow(step._expression_, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(remoteObject, wasThrown) {
                 InspectorTest.log("");
                 InspectorTest.log("-----------------------------------------------------");
                 InspectorTest.log("_expression_: " + step._expression_);

Modified: trunk/LayoutTests/inspector/timeline/exception-in-injected-script-while-recording.html (201854 => 201855)


--- trunk/LayoutTests/inspector/timeline/exception-in-injected-script-while-recording.html	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/LayoutTests/inspector/timeline/exception-in-injected-script-while-recording.html	2016-06-09 06:20:55 UTC (rev 201855)
@@ -50,7 +50,7 @@
     });
 
     function checkIfExceptionLoopsForever() {
-        WebInspector.runtimeManager.evaluateInInspectedWindow("({}).x.x", "test", true, true, false, false, false, function(result, wasThrown) {
+        WebInspector.runtimeManager.evaluateInInspectedWindow("({}).x.x", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) {
             InspectorTest.addResult("An exception was " + (wasThrown ? "" : "not ") + "thrown from the injected script.");
             WebInspector.debuggerManager.resume().then(function() {
                 InspectorTest.addResult("Debugger resumed; stopping timeline capture.");

Modified: trunk/Source/WebInspectorUI/ChangeLog (201854 => 201855)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-06-09 06:20:55 UTC (rev 201855)
@@ -1,3 +1,28 @@
+2016-06-08  Joseph Pecoraro  <[email protected]>
+
+        REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console
+        https://bugs.webkit.org/show_bug.cgi?id=158548
+        <rdar://problem/26708513>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Controllers/RuntimeManager.js:
+        (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow):
+        Switch the many parameters to an options dictionary.
+        Include a new option for sourceURL appender, so that
+        Console evaluations can have its own append.
+
+        * UserInterface/Controllers/_javascript_LogViewController.js:
+        (WebInspector._javascript_LogViewController.prototype.consolePromptTextCommitted):
+        Use the appendWebInspectorConsoleEvaluationSourceURL appender.
+
+        * UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js:
+        (WebInspector._javascript_RuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated):
+        * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+        (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection.):
+        (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
+        Use the new options dictionary.
+
 2016-06-08  Brian Burg  <[email protected]>
 
         Web Inspector: an error is encountered when trying to delete nodes that have children

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_LogViewController.js (201854 => 201855)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_LogViewController.js	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_LogViewController.js	2016-06-09 06:20:55 UTC (rev 201855)
@@ -231,9 +231,17 @@
             this._appendConsoleMessageView(commandResultMessageView, true);
         }
 
-        text = appendWebInspectorConsoleEvaluationSourceURL(text);
+        let options = {
+            objectGroup: WebInspector.RuntimeManager.ConsoleObjectGroup,
+            includeCommandLineAPI: true,
+            doNotPauseOnExceptionsAndMuteConsole: false,
+            returnByValue: false,
+            generatePreview: true,
+            saveResult: true,
+            sourceURLAppender: appendWebInspectorConsoleEvaluationSourceURL,
+        };
 
-        WebInspector.runtimeManager.evaluateInInspectedWindow(text, WebInspector.RuntimeManager.ConsoleObjectGroup, true, false, false, true, true, printResult.bind(this));
+        WebInspector.runtimeManager.evaluateInInspectedWindow(text, options, printResult.bind(this));
     }
 
     // Private

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js (201854 => 201855)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/_javascript_RuntimeCompletionProvider.js	2016-06-09 06:20:55 UTC (rev 201855)
@@ -102,8 +102,10 @@
         var activeCallFrame = WebInspector.debuggerManager.activeCallFrame;
         if (!base && activeCallFrame && !this._alwaysEvaluateInWindowContext)
             activeCallFrame.collectScopeChainVariableNames(receivedPropertyNames.bind(this));
-        else
-            WebInspector.runtimeManager.evaluateInInspectedWindow(base, "completion", true, true, false, false, false, evaluated.bind(this));
+        else {
+            let options = {objectGroup: "completion", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true, returnByValue: false, generatePreview: false, saveResult: false};
+            WebInspector.runtimeManager.evaluateInInspectedWindow(base, options, evaluated.bind(this));
+        }
 
         function updateLastPropertyNames(propertyNames)
         {
@@ -185,9 +187,10 @@
                 result.callFunctionJSON(inspectedPage_evalResult_getArrayCompletions, undefined, receivedArrayPropertyNames.bind(this));
             else if (result.type === "object" || result.type === "function")
                 result.callFunctionJSON(inspectedPage_evalResult_getCompletions, undefined, receivedPropertyNames.bind(this));
-            else if (result.type === "string" || result.type === "number" || result.type === "boolean" || result.type === "symbol")
-                WebInspector.runtimeManager.evaluateInInspectedWindow("(" + inspectedPage_evalResult_getCompletions + ")(\"" + result.type + "\")", "completion", false, true, true, false, false, receivedPropertyNamesFromEvaluate.bind(this));
-            else
+            else if (result.type === "string" || result.type === "number" || result.type === "boolean" || result.type === "symbol") {
+                let options = {objectGroup: "completion", includeCommandLineAPI: false, doNotPauseOnExceptionsAndMuteConsole: true, returnByValue: false, generatePreview: false, saveResult: false};
+                WebInspector.runtimeManager.evaluateInInspectedWindow("(" + inspectedPage_evalResult_getCompletions + ")(\"" + result.type + "\")", options, receivedPropertyNamesFromEvaluate.bind(this));
+            } else
                 console.error("Unknown result type: " + result.type);
         }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js (201854 => 201855)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js	2016-06-09 06:20:55 UTC (rev 201855)
@@ -35,8 +35,20 @@
 
     // Public
 
-    evaluateInInspectedWindow(_expression_, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, callback)
+    evaluateInInspectedWindow(_expression_, options, callback)
     {
+        let {objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, sourceURLAppender} = options;
+
+        includeCommandLineAPI = includeCommandLineAPI || false;
+        doNotPauseOnExceptionsAndMuteConsole = doNotPauseOnExceptionsAndMuteConsole || false;
+        returnByValue = returnByValue || false;
+        generatePreview = generatePreview || false;
+        saveResult = saveResult || false;
+        sourceURLAppender = sourceURLAppender || appendWebInspectorSourceURL;
+
+        console.assert(objectGroup, "RuntimeManager.evaluateInInspectedWindow should always be called with an objectGroup");
+        console.assert(typeof sourceURLAppender === "function");
+
         if (!_expression_) {
             // There is no _expression_, so the completion should happen against global properties.
             _expression_ = "this";
@@ -45,7 +57,7 @@
             _expression_ = "(" + _expression_ + ")";
         }
 
-        _expression_ = appendWebInspectorSourceURL(_expression_);
+        _expression_ = sourceURLAppender(_expression_);
 
         function evalCallback(error, result, wasThrown, savedResultIndex)
         {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (201854 => 201855)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js	2016-06-09 06:17:40 UTC (rev 201854)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js	2016-06-09 06:20:55 UTC (rev 201855)
@@ -350,7 +350,8 @@
         let promises = [];
         for (let _expression_ of watchExpressions) {
             promises.push(new Promise(function(resolve, reject) {
-                WebInspector.runtimeManager.evaluateInInspectedWindow(_expression_, WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName, false, true, false, true, false, function(object, wasThrown) {
+                let options = {objectGroup: WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName, includeCommandLineAPI: false, doNotPauseOnExceptionsAndMuteConsole: true, returnByValue: false, generatePreview: true, saveResult: false};
+                WebInspector.runtimeManager.evaluateInInspectedWindow(_expression_, options, function(object, wasThrown) {
                     let propertyDescriptor = new WebInspector.PropertyDescriptor({name: _expression_, value: object}, undefined, undefined, wasThrown);
                     objectTree.appendExtraPropertyDescriptor(propertyDescriptor);
                     resolve(propertyDescriptor);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to