Changeset 147356 in webkit
- Timestamp:
- Apr 1, 2013 1:33:04 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147355 r147356 1 2013-04-01 Timothy Hatcher <timothy@apple.com> 2 3 Make 'this' evaluate to the correct object when paused in the Debugger. 4 5 https://webkit.org/b/113607 6 rdar://problem/13538351 7 8 Reviewed by Joseph Pecoraro. 9 10 * platform/mac/http/tests/inspector/console-resource-errors-expected.txt: 11 1 12 2013-04-01 Victor Carbune <vcarbune@chromium.org> 2 13 -
trunk/LayoutTests/platform/mac/http/tests/inspector/console-resource-errors-expected.txt
r146840 r147356 5 5 GET http://127.0.0.1:8000/inspector/non-existent-iframe.html 404 (Not Found) non-existent-iframe.html:1 console-message console-error-level 6 6 GET http://127.0.0.1:8000/inspector/non-existent-script.js 404 (Not Found) console-resource-errors-iframe.html:4 console-message console-error-level 7 GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) [native code]:1send [native code]:1loadXHR console-resource-errors.html:18performActions console-resource-errors.html:10eval codeeval [native code]:1(anonymous function) _evaluateOn_evaluateAndWrapevaluate console-message console-error-level7 GET http://127.0.0.1:8000/inspector/non-existent-xhr 404 (Not Found) [native code]:1send [native code]:1loadXHR console-resource-errors.html:18performActions console-resource-errors.html:10eval codeeval [native code]:1(anonymous function)(anonymous function)_evaluateOn_evaluateAndWrapevaluate console-message console-error-level 8 8 -
trunk/Source/WebCore/ChangeLog
r147355 r147356 1 2013-04-01 Timothy Hatcher <timothy@apple.com> 2 3 Make 'this' evaluate to the correct object when paused in the Debugger. 4 5 https://webkit.org/b/113607 6 rdar://problem/13538351 7 8 Reviewed by Joseph Pecoraro. 9 10 * inspector/InjectedScriptSource.js: 11 (InjectedScript.prototype._evaluateOn): Bind 'this' to the expression function. 12 1 13 2013-04-01 Victor Carbune <vcarbune@chromium.org> 2 14 -
trunk/Source/WebCore/inspector/InjectedScriptSource.js
r147221 r147356 556 556 // create that provides the command line APIs. 557 557 558 var thisObject = isEvalOnCallFrame ? object : null;559 558 var parameters = [InjectedScriptHost.evaluate, expression]; 560 559 var expressionFunctionBody = "var __originalEval = window.eval; window.eval = __eval; try { return eval(__currentExpression); } finally { window.eval = __originalEval; }"; … … 567 566 // expressions with 'use strict';. 568 567 569 var commandLineAPI = new CommandLineAPI(this._commandLineAPIImpl, thisObject);568 var commandLineAPI = new CommandLineAPI(this._commandLineAPIImpl, isEvalOnCallFrame ? object : null); 570 569 var parameterNames = Object.getOwnPropertyNames(commandLineAPI); 571 572 570 for (var i = 0; i < parameterNames.length; ++i) 573 571 parameters.push(commandLineAPI[parameterNames[i]]); … … 580 578 } 581 579 582 var expressionFunction = evalFunction.call(thisObject, expressionFunctionString); 583 var result = expressionFunction.apply(thisObject, parameters); 580 // Bind 'this' to the function expression using another closure instead of Function.prototype.bind. This ensures things will work if the page replaces bind. 581 var boundExpressionFunctionString = "(function(__function, __thisObject) { return function() { return __function.apply(__thisObject, arguments) }; })(" + expressionFunctionString + ", this)"; 582 var expressionFunction = evalFunction.call(object, boundExpressionFunctionString); 583 var result = expressionFunction.apply(null, parameters); 584 584 585 585 if (objectGroup === "console")
Note: See TracChangeset
for help on using the changeset viewer.