Changeset 201855 in webkit
- Timestamp:
- Jun 8, 2016, 11:20:55 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/console/addInspectedNode.html (modified) (1 diff)
-
LayoutTests/inspector/console/command-line-api-copy.html (modified) (1 diff)
-
LayoutTests/inspector/console/command-line-api.html (modified) (1 diff)
-
LayoutTests/inspector/console/console-api.html (modified) (1 diff)
-
LayoutTests/inspector/console/console-table.html (modified) (1 diff)
-
LayoutTests/inspector/console/messagesCleared.html (modified) (1 diff)
-
LayoutTests/inspector/controller/runtime-controller.html (modified) (1 diff)
-
LayoutTests/inspector/debugger/command-line-api-exception-nested-catch.html (modified) (2 diffs)
-
LayoutTests/inspector/debugger/command-line-api-exception.html (modified) (2 diffs)
-
LayoutTests/inspector/model/remote-object-get-properties.html (modified) (1 diff)
-
LayoutTests/inspector/model/remote-object-weak-collection.html (modified) (1 diff)
-
LayoutTests/inspector/model/remote-object.html (modified) (1 diff)
-
LayoutTests/inspector/timeline/exception-in-injected-script-while-recording.html (modified) (1 diff)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js (modified) (2 diffs)
-
Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201852 r201855 1 2016-06-08 Joseph Pecoraro <pecoraro@apple.com> 2 3 REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console 4 https://bugs.webkit.org/show_bug.cgi?id=158548 5 <rdar://problem/26708513> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/console/addInspectedNode.html: 10 * inspector/console/command-line-api-copy.html: 11 * inspector/console/command-line-api.html: 12 * inspector/console/console-api.html: 13 * inspector/console/console-table.html: 14 * inspector/console/messagesCleared.html: 15 * inspector/controller/runtime-controller.html: 16 * inspector/debugger/command-line-api-exception-nested-catch.html: 17 * inspector/debugger/command-line-api-exception.html: 18 * inspector/model/remote-object-get-properties.html: 19 * inspector/model/remote-object-weak-collection.html: 20 * inspector/model/remote-object.html: 21 * inspector/timeline/exception-in-injected-script-while-recording.html: 22 Update evaluateInInspectedWindow callsites to use options dictionary. 23 1 24 2016-06-08 Chris Dumez <cdumez@apple.com> 2 25 -
trunk/LayoutTests/inspector/console/addInspectedNode.html
r189373 r201855 7 7 { 8 8 function evaluate$0(callback) { 9 const objectGroup = "test"; 10 const includeCommandLineAPI = true; 11 const ignorePauseOnExceptionsAndMute = false; 12 const shouldReturnByValue = false; 13 const shouldGeneratePreview = false; 14 const shouldSaveResult = false; 15 WebInspector.runtimeManager.evaluateInInspectedWindow("$0", objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, callback); 9 WebInspector.runtimeManager.evaluateInInspectedWindow("$0", {objectGroup: "test", includeCommandLineAPI: true}, callback); 16 10 } 17 11 -
trunk/LayoutTests/inspector/console/command-line-api-copy.html
r196270 r201855 23 23 24 24 function commandLineAPICopyAndPaste(expression, callback) { 25 const objectGroup = "test";26 const includeCommandLineAPI = true;27 const ignorePauseOnExceptionsAndMute = false;28 const shouldReturnByValue = false;29 const shouldGeneratePreview = false;30 const shouldSaveResult = false;31 25 InspectorTest.assert(typeof expression === "string", "Test requires string expression to evaluate on the page."); 32 WebInspector.runtimeManager.evaluateInInspectedWindow(`copy(${expression})`, objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, () => {26 WebInspector.runtimeManager.evaluateInInspectedWindow(`copy(${expression})`, {objectGroup: "test", includeCommandLineAPI: true}, () => { 33 27 InspectorTest.evaluateInPage("pasteAndReturnString()", (error, remoteObjectPayload) => { 34 28 let remoteObject = WebInspector.RemoteObject.fromPayload(remoteObjectPayload); -
trunk/LayoutTests/inspector/console/command-line-api.html
r189226 r201855 70 70 } 71 71 72 const objectGroup = "test"; 73 const includeCommandLineAPI = true; 74 const ignorePauseOnExceptionsAndMute = false; 75 const shouldReturnByValue = false; 76 const shouldGeneratePreview = false; 77 const shouldSaveResult = false; 78 WebInspector.runtimeManager.evaluateInInspectedWindow(`String(${input})`, objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, callback); 72 WebInspector.runtimeManager.evaluateInInspectedWindow(`String(${input})`, {objectGroup: "test", includeCommandLineAPI: true}, callback); 79 73 } 80 74 }) -
trunk/LayoutTests/inspector/console/console-api.html
r194887 r201855 67 67 68 68 for (var step of steps) 69 WebInspector.runtimeManager.evaluateInInspectedWindow(step, "test", false, true, false, true, false, function(){});69 WebInspector.runtimeManager.evaluateInInspectedWindow(step, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(){}); 70 70 } 71 71 </script> -
trunk/LayoutTests/inspector/console/console-table.html
r199793 r201855 45 45 46 46 for (var step of steps) 47 WebInspector.runtimeManager.evaluateInInspectedWindow(step, "test", false, true, false, true, false, function(){});47 WebInspector.runtimeManager.evaluateInInspectedWindow(step, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(){}); 48 48 } 49 49 </script> -
trunk/LayoutTests/inspector/console/messagesCleared.html
r189373 r201855 36 36 description: "Calling `clear()` in the command line API should trigger Console.messagesCleared.", 37 37 test: (resolve, reject) => { 38 const objectGroup = "test"; 39 const includeCommandLineAPI = true; 40 const ignorePauseOnExceptionsAndMute = false; 41 const shouldReturnByValue = false; 42 const shouldGeneratePreview = false; 43 const shouldSaveResult = false; 44 WebInspector.runtimeManager.evaluateInInspectedWindow("clear()", objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, function(){}); 38 WebInspector.runtimeManager.evaluateInInspectedWindow("clear()", {objectGroup: "test", includeCommandLineAPI: true}, function(){}); 45 39 WebInspector.logManager.singleFireEventListener(WebInspector.LogManager.Event.Cleared, (event) => { 46 40 InspectorTest.expectThat(event, "Cleared event should fire."); -
trunk/LayoutTests/inspector/controller/runtime-controller.html
r194149 r201855 13 13 test: (resolve, reject) => { 14 14 function testSource(expression, callback) { 15 const objectGroup = "test"; 16 const includeCommandLineAPI = false; 17 const ignorePauseOnExceptionsAndMute = false; 18 const shouldReturnByValue = false; 19 const shouldGeneratePreview = false; 20 const shouldSaveResult = false; 21 WebInspector.runtimeManager.evaluateInInspectedWindow(expression, objectGroup, includeCommandLineAPI, ignorePauseOnExceptionsAndMute, shouldReturnByValue, shouldGeneratePreview, shouldSaveResult, (result, wasThrown) => { 15 WebInspector.runtimeManager.evaluateInInspectedWindow(expression, {objectGroup: "test"}, (result, wasThrown) => { 22 16 InspectorTest.log("Source: " + expression); 23 17 callback(result, wasThrown); -
trunk/LayoutTests/inspector/debugger/command-line-api-exception-nested-catch.html
r188059 r201855 17 17 18 18 function dumpCommandLineAPIValue(prefix) { 19 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", "test", true, true, false, false, false, function(result, wasThrown) {19 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) { 20 20 InspectorTest.log(prefix + ": $exception => " + result.description); 21 21 }); … … 23 23 24 24 function checkIfExceptionValueMatchesVariable(varName) { 25 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === " + varName, "test", true, true, false, false, false, function(result, wasThrown) {25 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === " + varName, {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) { 26 26 InspectorTest.log(" CATCH: $exception === " + varName + " ? " + result.description); 27 27 }); -
trunk/LayoutTests/inspector/debugger/command-line-api-exception.html
r188059 r201855 41 41 42 42 function dumpCommandLineAPIValue(prefix) { 43 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", "test", true, true, false, false, false, function(result, wasThrown) {43 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) { 44 44 InspectorTest.log(prefix + ": $exception => " + result.description); 45 45 }); … … 47 47 48 48 function checkIfExceptionValueMatchesCatchVariable() { 49 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === e", "test", true, true, false, false, false, function(result, wasThrown) {49 WebInspector.runtimeManager.evaluateInInspectedWindow("$exception === e", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) { 50 50 InspectorTest.log("STEPPED OUT TO CATCH BLOCK: $exception === e ? " + result.description); 51 51 }); -
trunk/LayoutTests/inspector/model/remote-object-get-properties.html
r188059 r201855 76 76 InspectorTest.log("EXPRESSION: " + step.expression); 77 77 78 WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, "test", false, true, false, false, false, function(remoteObject, wasThrown) {78 WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true}, function(remoteObject, wasThrown) { 79 79 InspectorTest.assert(remoteObject instanceof WebInspector.RemoteObject); 80 80 InspectorTest.log("type: " + remoteObject.type); -
trunk/LayoutTests/inspector/model/remote-object-weak-collection.html
r188059 r201855 54 54 // Run the expression, and then run a garbage collection on a different 55 55 // event loop so no objects are kept alive by the stack. 56 WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, "test", false, true, false, true, false, function(remoteObject, wasThrown) {57 WebInspector.runtimeManager.evaluateInInspectedWindow("GCController.collect()", "test", false, true, false, false, false, function() {56 WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(remoteObject, wasThrown) { 57 WebInspector.runtimeManager.evaluateInInspectedWindow("GCController.collect()", {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true}, function() { 58 58 InspectorTest.assert(remoteObject instanceof WebInspector.RemoteObject); 59 59 remoteObject.getCollectionEntries(0, 100, function(entries) { -
trunk/LayoutTests/inspector/model/remote-object.html
r199529 r201855 216 216 } 217 217 218 WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, "test", false, true, false, true, false, function(remoteObject, wasThrown) {218 WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, {objectGroup: "test", doNotPauseOnExceptionsAndMuteConsole: true, generatePreview: true}, function(remoteObject, wasThrown) { 219 219 InspectorTest.log(""); 220 220 InspectorTest.log("-----------------------------------------------------"); -
trunk/LayoutTests/inspector/timeline/exception-in-injected-script-while-recording.html
r188644 r201855 51 51 52 52 function checkIfExceptionLoopsForever() { 53 WebInspector.runtimeManager.evaluateInInspectedWindow("({}).x.x", "test", true, true, false, false, false, function(result, wasThrown) {53 WebInspector.runtimeManager.evaluateInInspectedWindow("({}).x.x", {objectGroup: "test", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true}, function(result, wasThrown) { 54 54 InspectorTest.addResult("An exception was " + (wasThrown ? "" : "not ") + "thrown from the injected script."); 55 55 WebInspector.debuggerManager.resume().then(function() { -
trunk/Source/WebInspectorUI/ChangeLog
r201843 r201855 1 2016-06-08 Joseph Pecoraro <pecoraro@apple.com> 2 3 REGRESSION: Web Inspector: Should be able to evaluate "{a:1, b:2}" in the console 4 https://bugs.webkit.org/show_bug.cgi?id=158548 5 <rdar://problem/26708513> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Controllers/RuntimeManager.js: 10 (WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow): 11 Switch the many parameters to an options dictionary. 12 Include a new option for sourceURL appender, so that 13 Console evaluations can have its own append. 14 15 * UserInterface/Controllers/JavaScriptLogViewController.js: 16 (WebInspector.JavaScriptLogViewController.prototype.consolePromptTextCommitted): 17 Use the appendWebInspectorConsoleEvaluationSourceURL appender. 18 19 * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js: 20 (WebInspector.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.evaluated): 21 * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: 22 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection.): 23 (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection): 24 Use the new options dictionary. 25 1 26 2016-06-08 Brian Burg <bburg@apple.com> 2 27 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js
r201222 r201855 232 232 } 233 233 234 text = appendWebInspectorConsoleEvaluationSourceURL(text); 235 236 WebInspector.runtimeManager.evaluateInInspectedWindow(text, WebInspector.RuntimeManager.ConsoleObjectGroup, true, false, false, true, true, printResult.bind(this)); 234 let options = { 235 objectGroup: WebInspector.RuntimeManager.ConsoleObjectGroup, 236 includeCommandLineAPI: true, 237 doNotPauseOnExceptionsAndMuteConsole: false, 238 returnByValue: false, 239 generatePreview: true, 240 saveResult: true, 241 sourceURLAppender: appendWebInspectorConsoleEvaluationSourceURL, 242 }; 243 244 WebInspector.runtimeManager.evaluateInInspectedWindow(text, options, printResult.bind(this)); 237 245 } 238 246 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js
r200505 r201855 103 103 if (!base && activeCallFrame && !this._alwaysEvaluateInWindowContext) 104 104 activeCallFrame.collectScopeChainVariableNames(receivedPropertyNames.bind(this)); 105 else 106 WebInspector.runtimeManager.evaluateInInspectedWindow(base, "completion", true, true, false, false, false, evaluated.bind(this)); 105 else { 106 let options = {objectGroup: "completion", includeCommandLineAPI: true, doNotPauseOnExceptionsAndMuteConsole: true, returnByValue: false, generatePreview: false, saveResult: false}; 107 WebInspector.runtimeManager.evaluateInInspectedWindow(base, options, evaluated.bind(this)); 108 } 107 109 108 110 function updateLastPropertyNames(propertyNames) … … 186 188 else if (result.type === "object" || result.type === "function") 187 189 result.callFunctionJSON(inspectedPage_evalResult_getCompletions, undefined, receivedPropertyNames.bind(this)); 188 else if (result.type === "string" || result.type === "number" || result.type === "boolean" || result.type === "symbol") 189 WebInspector.runtimeManager.evaluateInInspectedWindow("(" + inspectedPage_evalResult_getCompletions + ")(\"" + result.type + "\")", "completion", false, true, true, false, false, receivedPropertyNamesFromEvaluate.bind(this)); 190 else 190 else if (result.type === "string" || result.type === "number" || result.type === "boolean" || result.type === "symbol") { 191 let options = {objectGroup: "completion", includeCommandLineAPI: false, doNotPauseOnExceptionsAndMuteConsole: true, returnByValue: false, generatePreview: false, saveResult: false}; 192 WebInspector.runtimeManager.evaluateInInspectedWindow("(" + inspectedPage_evalResult_getCompletions + ")(\"" + result.type + "\")", options, receivedPropertyNamesFromEvaluate.bind(this)); 193 } else 191 194 console.error("Unknown result type: " + result.type); 192 195 } -
trunk/Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js
r194149 r201855 36 36 // Public 37 37 38 evaluateInInspectedWindow(expression, o bjectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, callback)38 evaluateInInspectedWindow(expression, options, callback) 39 39 { 40 let {objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, saveResult, sourceURLAppender} = options; 41 42 includeCommandLineAPI = includeCommandLineAPI || false; 43 doNotPauseOnExceptionsAndMuteConsole = doNotPauseOnExceptionsAndMuteConsole || false; 44 returnByValue = returnByValue || false; 45 generatePreview = generatePreview || false; 46 saveResult = saveResult || false; 47 sourceURLAppender = sourceURLAppender || appendWebInspectorSourceURL; 48 49 console.assert(objectGroup, "RuntimeManager.evaluateInInspectedWindow should always be called with an objectGroup"); 50 console.assert(typeof sourceURLAppender === "function"); 51 40 52 if (!expression) { 41 53 // There is no expression, so the completion should happen against global properties. … … 46 58 } 47 59 48 expression = appendWebInspectorSourceURL(expression);60 expression = sourceURLAppender(expression); 49 61 50 62 function evalCallback(error, result, wasThrown, savedResultIndex) -
trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js
r201620 r201855 351 351 for (let expression of watchExpressions) { 352 352 promises.push(new Promise(function(resolve, reject) { 353 WebInspector.runtimeManager.evaluateInInspectedWindow(expression, WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName, false, true, false, true, false, function(object, wasThrown) { 353 let options = {objectGroup: WebInspector.ScopeChainDetailsSidebarPanel.WatchExpressionsObjectGroupName, includeCommandLineAPI: false, doNotPauseOnExceptionsAndMuteConsole: true, returnByValue: false, generatePreview: true, saveResult: false}; 354 WebInspector.runtimeManager.evaluateInInspectedWindow(expression, options, function(object, wasThrown) { 354 355 let propertyDescriptor = new WebInspector.PropertyDescriptor({name: expression, value: object}, undefined, undefined, wasThrown); 355 356 objectTree.appendExtraPropertyDescriptor(propertyDescriptor);
Note:
See TracChangeset
for help on using the changeset viewer.