diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/inspector/front-end/ConsoleView.js | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/inspector/front-end/ConsoleView.js')
-rw-r--r-- | Source/WebCore/inspector/front-end/ConsoleView.js | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/Source/WebCore/inspector/front-end/ConsoleView.js b/Source/WebCore/inspector/front-end/ConsoleView.js index 35d1ebf..f59d87f 100644 --- a/Source/WebCore/inspector/front-end/ConsoleView.js +++ b/Source/WebCore/inspector/front-end/ConsoleView.js @@ -316,7 +316,7 @@ WebInspector.ConsoleView.prototype = { requestClearMessages: function() { - InspectorBackend.clearConsoleMessages(); + ConsoleAgent.clearConsoleMessages(); }, clearMessages: function() @@ -353,21 +353,30 @@ WebInspector.ConsoleView.prototype = { if (!expressionString && !prefix) return; - var reportCompletions = this._reportCompletions.bind(this, bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix); - // Collect comma separated object properties for the completion. + this.evalInInspectedWindow(expressionString, "completion", true, evaluated.bind(this)); - var includeCommandLineAPI = (!dotNotation && !bracketNotation); - var injectedScriptAccess; - if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) - InspectorBackend.getCompletionsOnCallFrame(WebInspector.panels.scripts.selectedCallFrameId(), expressionString, includeCommandLineAPI, reportCompletions); - else - InspectorBackend.getCompletions(expressionString, includeCommandLineAPI, reportCompletions); - }, + function evaluated(result) + { + if (!result) + return; + result.getProperties(true, false, evaluatedProperties.bind(this)); + } - _reportCompletions: function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, result, isException) { - if (isException) - return; + function evaluatedProperties(properties) + { + RuntimeAgent.releaseObjectGroup(0, "completion"); + var propertyNames = []; + for (var i = 0; properties && i < properties.length; ++i) + propertyNames.push(properties[i].name); + + var includeCommandLineAPI = (!dotNotation && !bracketNotation); + if (includeCommandLineAPI) + propertyNames.splice(0, 0, "dir", "dirxml", "keys", "values", "profile", "profileEnd", "monitorEvents", "unmonitorEvents", "inspect", "copy", "clear"); + this._reportCompletions(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, propertyNames); + } + }, + _reportCompletions: function(bestMatchOnly, completionsReadyCallback, dotNotation, bracketNotation, prefix, properties) { if (bracketNotation) { if (prefix.length && prefix[0] === "'") var quoteUsed = "'"; @@ -376,7 +385,7 @@ WebInspector.ConsoleView.prototype = { } var results = []; - var properties = Object.keys(result).sort(); + properties.sort(); for (var i = 0; i < properties.length; ++i) { var property = properties[i]; @@ -417,7 +426,7 @@ WebInspector.ConsoleView.prototype = { var itemAction = function () { WebInspector.settings.monitoringXHREnabled = !WebInspector.settings.monitoringXHREnabled; - InspectorBackend.setMonitoringXHREnabled(WebInspector.settings.monitoringXHREnabled); + ConsoleAgent.setMonitoringXHREnabled(WebInspector.settings.monitoringXHREnabled); }.bind(this); var contextMenu = new WebInspector.ContextMenu(); contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), itemAction, WebInspector.settings.monitoringXHREnabled) @@ -513,7 +522,7 @@ WebInspector.ConsoleView.prototype = { evalInInspectedWindow: function(expression, objectGroup, includeCommandLineAPI, callback) { if (WebInspector.panels.scripts && WebInspector.panels.scripts.paused) { - WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, objectGroup, includeCommandLineAPI, callback); + WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, objectGroup, includeCommandLineAPI, callback); return; } @@ -526,7 +535,7 @@ WebInspector.ConsoleView.prototype = { { callback(WebInspector.RemoteObject.fromPayload(result)); } - InspectorBackend.evaluate(expression, objectGroup, includeCommandLineAPI, evalCallback); + RuntimeAgent.evaluate(expression, objectGroup, includeCommandLineAPI, evalCallback); }, _enterKeyPressed: function(event) |