Starting in r146840, attempting to use the "this" object in the Web Inspector while at a breakpoint will reveal the JavaScriptCallFrame object instead of the "this" object that is currently in the scope of the execution state.
<rdar://problem/13538351>
Created attachment 195834 [details] Proposed Change
Comment on attachment 195834 [details] Proposed Change 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.
Comment on attachment 195834 [details] Proposed Change Clearing flags on attachment: 195834 Committed r147356: <http://trac.webkit.org/changeset/147356>
All reviewed patches have been landed. Closing bug.