OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 | 969 |
970 /** | 970 /** |
971 * @param {!Object} topCallFrame | 971 * @param {!Object} topCallFrame |
972 * @param {!Object} parsedCallFrameId | 972 * @param {!Object} parsedCallFrameId |
973 * @param {!Array.<!Object>} asyncCallStacks | 973 * @param {!Array.<!Object>} asyncCallStacks |
974 * @return {?Object} | 974 * @return {?Object} |
975 */ | 975 */ |
976 _callFrameForParsedId: function(topCallFrame, parsedCallFrameId, asyncCallSt
acks) | 976 _callFrameForParsedId: function(topCallFrame, parsedCallFrameId, asyncCallSt
acks) |
977 { | 977 { |
978 var asyncOrdinal = parsedCallFrameId["asyncOrdinal"]; // 1-based index | 978 var asyncOrdinal = parsedCallFrameId["asyncOrdinal"]; // 1-based index |
979 if (asyncOrdinal) | 979 // FIXMEDART: change this next line back to |
| 980 // if (asyncOrdinal) |
| 981 // once we can remove the hack of giving JavaScript callframes from |
| 982 // mixed Dart-JavaScript call stacks ordinal -1 to trigger the |
| 983 // safer code path used to simulate evaluating code on the call frame |
| 984 // for async call frames. |
| 985 if (asyncOrdinal >= 1) |
980 topCallFrame = asyncCallStacks[asyncOrdinal - 1]; | 986 topCallFrame = asyncCallStacks[asyncOrdinal - 1]; |
981 var ordinal = parsedCallFrameId["ordinal"]; | 987 var ordinal = parsedCallFrameId["ordinal"]; |
982 var callFrame = topCallFrame; | 988 var callFrame = topCallFrame; |
983 while (--ordinal >= 0 && callFrame) | 989 while (--ordinal >= 0 && callFrame) |
984 callFrame = callFrame.caller; | 990 callFrame = callFrame.caller; |
985 return callFrame; | 991 return callFrame; |
986 }, | 992 }, |
987 | 993 |
988 /** | 994 /** |
989 * @param {!Object} objectId | 995 * @param {!Object} objectId |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 * @constructor | 1395 * @constructor |
1390 * @param {number} ordinal | 1396 * @param {number} ordinal |
1391 * @param {!Object} callFrame | 1397 * @param {!Object} callFrame |
1392 * @param {number} asyncOrdinal | 1398 * @param {number} asyncOrdinal |
1393 */ | 1399 */ |
1394 InjectedScript.CallFrameProxy = function(ordinal, callFrame, asyncOrdinal) | 1400 InjectedScript.CallFrameProxy = function(ordinal, callFrame, asyncOrdinal) |
1395 { | 1401 { |
1396 this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + in
jectedScriptId + (asyncOrdinal ? ",\"asyncOrdinal\":" + asyncOrdinal : "") + "}"
; | 1402 this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + in
jectedScriptId + (asyncOrdinal ? ",\"asyncOrdinal\":" + asyncOrdinal : "") + "}"
; |
1397 this.functionName = (callFrame.type === "function" ? callFrame.functionName
: ""); | 1403 this.functionName = (callFrame.type === "function" ? callFrame.functionName
: ""); |
1398 this.location = { scriptId: toString(callFrame.sourceID), lineNumber: callFr
ame.line, columnNumber: callFrame.column, __proto__: null }; | 1404 this.location = { scriptId: toString(callFrame.sourceID), lineNumber: callFr
ame.line, columnNumber: callFrame.column, __proto__: null }; |
| 1405 this.framePointerHigh = callFrame.framePointerHigh; |
| 1406 this.framePointerLow = callFrame.framePointerLow; |
1399 this.scopeChain = this._wrapScopeChain(callFrame); | 1407 this.scopeChain = this._wrapScopeChain(callFrame); |
1400 this.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); | 1408 this.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); |
1401 if (callFrame.isAtReturn) | 1409 if (callFrame.isAtReturn) |
1402 this.returnValue = injectedScript._wrapObject(callFrame.returnValue, "ba
cktrace"); | 1410 this.returnValue = injectedScript._wrapObject(callFrame.returnValue, "ba
cktrace"); |
1403 } | 1411 } |
1404 | 1412 |
1405 InjectedScript.CallFrameProxy.prototype = { | 1413 InjectedScript.CallFrameProxy.prototype = { |
1406 /** | 1414 /** |
1407 * @param {!Object} callFrame | 1415 * @param {!Object} callFrame |
1408 * @return {!Array.<!DebuggerAgent.Scope>} | 1416 * @return {!Array.<!DebuggerAgent.Scope>} |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 */ | 1813 */ |
1806 _logEvent: function(event) | 1814 _logEvent: function(event) |
1807 { | 1815 { |
1808 inspectedWindow.console.log(event.type, event); | 1816 inspectedWindow.console.log(event.type, event); |
1809 } | 1817 } |
1810 } | 1818 } |
1811 | 1819 |
1812 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1820 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
1813 return injectedScript; | 1821 return injectedScript; |
1814 }) | 1822 }) |
OLD | NEW |