[Webkit-unassigned] [Bug 118314] Web Inspector: cannot access `arguments` object from the console while debugger is paused

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 8 19:13:01 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=118314

--- Comment #4 from Joseph Pecoraro <joepeck at webkit.org> ---
Evaluating in the console is doing some very non-trivial stuff. Check out InjectedScript.prototype._evaluteOn in Source/JavaScriptCore/inspector/InjectedScriptSource.js.

If you say "arguments" in the console it is boiling down to something like this:

> var expressionFunctionBody = "" +
>     "var global = Function('return this')() || (1, eval)('this');" +
>     "var __originalEval = global.eval; global.eval = __eval;" +
>     "try { return eval(__currentExpression); }" +
>     "finally { global.eval = __originalEval; }";
> 
> var expressionFunctionString = "(function(__eval, __currentExpression, " + parameterNames.join(", ") + ") { " + expressionFunctionBody + " })";
> var boundExpressionFunctionString = "(function(__function, __thisObject) { return function() { return __function.apply(__thisObject, arguments) }; })(" + expressionFunctionString + ", this)";
> 
> var parameters = [InjectedScriptHost.evaluate, expression];
> var expressionFunction = evalFunction.call(object, boundExpressionFunctionString);
> var result = expressionFunction.apply(null, parameters);

You may be able to see some of this if you sprinkle around some "//# sourceURL=foo".

The Scope Chain sidebar values are populated from the actual scope chain objects from JavaScriptCore.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150109/0a8ea9b4/attachment-0002.html>


More information about the webkit-unassigned mailing list