[webkit-reviews] review granted: [Bug 113607] REGRESSION(r146840): At breakpoints, inspector's "this" refers to JavaScriptCallFrame : [Attachment 195834] Proposed Change

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 1 11:15:34 PDT 2013


Joseph Pecoraro <joepeck at webkit.org> has granted Timothy Hatcher
<timothy at apple.com>'s request for review:
Bug 113607: REGRESSION(r146840): At breakpoints, inspector's "this" refers to
JavaScriptCallFrame
https://bugs.webkit.org/show_bug.cgi?id=113607

Attachment 195834: Proposed Change
https://bugs.webkit.org/attachment.cgi?id=195834&action=review

------- Additional Comments from Joseph Pecoraro <joepeck at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=195834&action=review


Change looks good. It might be nice to create a test for this.

> Source/WebCore/inspector/InjectedScriptSource.js:583
> +	       // Bind 'this' to the function expression using another closure
instead of Function.prototype.bind. This ensures things will work if the page
replaces bind.
> +	       var boundExpressionFunctionString = "(function(__function,
__thisObject) { return function() { return __function.apply(__thisObject,
arguments) }; })(" + expressionFunctionString + ", this)";
> +	       var expressionFunction = evalFunction.call(object,
boundExpressionFunctionString);
> +	       var result = expressionFunction.apply(null, parameters);

Hmm, there are uses of Function.prototype.apply and Function.prototype.call
here which can be overridden by the page. We may need to look into providing
those from the backend like evalFunction.


More information about the webkit-reviews mailing list