| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 { | 71 { |
| 72 if (typeof obj === "number" && obj === 0 && 1 / obj < 0) | 72 if (typeof obj === "number" && obj === 0 && 1 / obj < 0) |
| 73 return "-0"; // Negative zero. | 73 return "-0"; // Negative zero. |
| 74 return "" + obj; | 74 return "" + obj; |
| 75 } | 75 } |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Please use this bind, not the one from Function.prototype | 78 * Please use this bind, not the one from Function.prototype |
| 79 * @param {function(...)} func | 79 * @param {function(...)} func |
| 80 * @param {Object} thisObject | 80 * @param {Object} thisObject |
| 81 * @param {...number} var_args | 81 * @param {...} var_args |
| 82 */ | 82 */ |
| 83 function bind(func, thisObject, var_args) | 83 function bind(func, thisObject, var_args) |
| 84 { | 84 { |
| 85 var args = slice(arguments, 2); | 85 var args = slice(arguments, 2); |
| 86 | 86 |
| 87 /** | 87 /** |
| 88 * @param {...number} var_args | 88 * @param {...} var_args |
| 89 */ | 89 */ |
| 90 function bound(var_args) | 90 function bound(var_args) |
| 91 { | 91 { |
| 92 return func.apply(thisObject, args.concat(slice(arguments))); | 92 return func.apply(thisObject, args.concat(slice(arguments))); |
| 93 } | 93 } |
| 94 bound.toString = function() { | 94 bound.toString = function() |
| 95 { |
| 95 return "bound: " + func; | 96 return "bound: " + func; |
| 96 }; | 97 }; |
| 97 return bound; | 98 return bound; |
| 98 } | 99 } |
| 99 | 100 |
| 100 /** | 101 /** |
| 101 * @param {T} obj | 102 * @param {T} obj |
| 102 * @return {T} | 103 * @return {T} |
| 103 * @template T | 104 * @template T |
| 104 */ | 105 */ |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 return this._createThrownValue(e, objectGroup); | 558 return this._createThrownValue(e, objectGroup); |
| 558 } | 559 } |
| 559 }, | 560 }, |
| 560 | 561 |
| 561 /** | 562 /** |
| 562 * Resolves a value from CallArgument description. | 563 * Resolves a value from CallArgument description. |
| 563 * @param {RuntimeAgent.CallArgument} callArgumentJson | 564 * @param {RuntimeAgent.CallArgument} callArgumentJson |
| 564 * @return {*} resolved value | 565 * @return {*} resolved value |
| 565 * @throws {string} error message | 566 * @throws {string} error message |
| 566 */ | 567 */ |
| 567 _resolveCallArgument: function(callArgumentJson) { | 568 _resolveCallArgument: function(callArgumentJson) |
| 569 { |
| 568 callArgumentJson = nullifyObjectProto(callArgumentJson); | 570 callArgumentJson = nullifyObjectProto(callArgumentJson); |
| 569 var objectId = callArgumentJson.objectId; | 571 var objectId = callArgumentJson.objectId; |
| 570 if (objectId) { | 572 if (objectId) { |
| 571 var parsedArgId = this._parseObjectId(objectId); | 573 var parsedArgId = this._parseObjectId(objectId); |
| 572 if (!parsedArgId || parsedArgId["injectedScriptId"] !== injectedScri
ptId) | 574 if (!parsedArgId || parsedArgId["injectedScriptId"] !== injectedScri
ptId) |
| 573 throw "Arguments should belong to the same JavaScript world as t
he target object."; | 575 throw "Arguments should belong to the same JavaScript world as t
he target object."; |
| 574 | 576 |
| 575 var resolvedArg = this._objectForId(parsedArgId); | 577 var resolvedArg = this._objectForId(parsedArgId); |
| 576 if (!this._isDefined(resolvedArg)) | 578 if (!this._isDefined(resolvedArg)) |
| 577 throw "Could not find object with given id"; | 579 throw "Could not find object with given id"; |
| 578 | 580 |
| 579 return resolvedArg; | 581 return resolvedArg; |
| 580 } else if ("value" in callArgumentJson) { | 582 } else if ("value" in callArgumentJson) { |
| 581 return callArgumentJson.value; | 583 return callArgumentJson.value; |
| 582 } | 584 } |
| 583 return undefined; | 585 return undefined; |
| 584 }, | 586 }, |
| 585 | 587 |
| 586 /** | 588 /** |
| 587 * @param {Function} evalFunction | 589 * @param {Function} evalFunction |
| 588 * @param {Object} object | 590 * @param {Object} object |
| 589 * @param {string} objectGroup | 591 * @param {string} objectGroup |
| 590 * @param {boolean} isEvalOnCallFrame | 592 * @param {boolean} isEvalOnCallFrame |
| 591 * @param {boolean} injectCommandLineAPI | 593 * @param {boolean} injectCommandLineAPI |
| 592 * @param {boolean} returnByValue | 594 * @param {boolean} returnByValue |
| 593 * @param {boolean} generatePreview | 595 * @param {boolean} generatePreview |
| 596 * @param {!Array.<!Object>=} scopeChain |
| 594 * @return {!Object} | 597 * @return {!Object} |
| 595 */ | 598 */ |
| 596 _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, is
EvalOnCallFrame, injectCommandLineAPI, returnByValue, generatePreview) | 599 _evaluateAndWrap: function(evalFunction, object, expression, objectGroup, is
EvalOnCallFrame, injectCommandLineAPI, returnByValue, generatePreview, scopeChai
n) |
| 597 { | 600 { |
| 598 try { | 601 try { |
| 599 return { wasThrown: false, | 602 return { wasThrown: false, |
| 600 result: this._wrapObject(this._evaluateOn(evalFunction, obj
ect, objectGroup, expression, isEvalOnCallFrame, injectCommandLineAPI), objectGr
oup, returnByValue, generatePreview), | 603 result: this._wrapObject(this._evaluateOn(evalFunction, obj
ect, objectGroup, expression, isEvalOnCallFrame, injectCommandLineAPI, scopeChai
n), objectGroup, returnByValue, generatePreview), |
| 601 __proto__: null }; | 604 __proto__: null }; |
| 602 } catch (e) { | 605 } catch (e) { |
| 603 return this._createThrownValue(e, objectGroup); | 606 return this._createThrownValue(e, objectGroup); |
| 604 } | 607 } |
| 605 }, | 608 }, |
| 606 | 609 |
| 607 /** | 610 /** |
| 608 * @param {*} value | 611 * @param {*} value |
| 609 * @param {string} objectGroup | 612 * @param {string} objectGroup |
| 610 * @return {!Object} | 613 * @return {!Object} |
| 611 */ | 614 */ |
| 612 _createThrownValue: function(value, objectGroup) | 615 _createThrownValue: function(value, objectGroup) |
| 613 { | 616 { |
| 614 var remoteObject = this._wrapObject(value, objectGroup); | 617 var remoteObject = this._wrapObject(value, objectGroup); |
| 615 try { | 618 try { |
| 616 remoteObject.description = toStringDescription(value); | 619 remoteObject.description = toStringDescription(value); |
| 617 } catch (e) {} | 620 } catch (e) {} |
| 618 return { wasThrown: true, result: remoteObject, __proto__: null }; | 621 return { wasThrown: true, result: remoteObject, __proto__: null }; |
| 619 }, | 622 }, |
| 620 | 623 |
| 621 /** | 624 /** |
| 622 * @param {Function} evalFunction | 625 * @param {Function} evalFunction |
| 623 * @param {Object} object | 626 * @param {Object} object |
| 624 * @param {string} objectGroup | 627 * @param {string} objectGroup |
| 625 * @param {string} expression | 628 * @param {string} expression |
| 626 * @param {boolean} isEvalOnCallFrame | 629 * @param {boolean} isEvalOnCallFrame |
| 627 * @param {boolean} injectCommandLineAPI | 630 * @param {boolean} injectCommandLineAPI |
| 631 * @param {!Array.<!Object>=} scopeChain |
| 628 * @return {*} | 632 * @return {*} |
| 629 */ | 633 */ |
| 630 _evaluateOn: function(evalFunction, object, objectGroup, expression, isEvalO
nCallFrame, injectCommandLineAPI) | 634 _evaluateOn: function(evalFunction, object, objectGroup, expression, isEvalO
nCallFrame, injectCommandLineAPI, scopeChain) |
| 631 { | 635 { |
| 632 // Only install command line api object for the time of evaluation. | 636 // Only install command line api object for the time of evaluation. |
| 633 // Surround the expression in with statements to inject our command line
API so that | 637 // Surround the expression in with statements to inject our command line
API so that |
| 634 // the window object properties still take more precedent than our API f
unctions. | 638 // the window object properties still take more precedent than our API f
unctions. |
| 635 | 639 |
| 640 var injectScopeChain = scopeChain && scopeChain.length; |
| 641 |
| 636 try { | 642 try { |
| 643 var prefix = ""; |
| 644 var suffix = ""; |
| 637 if (injectCommandLineAPI && inspectedWindow.console) { | 645 if (injectCommandLineAPI && inspectedWindow.console) { |
| 638 inspectedWindow.console._commandLineAPI = new CommandLineAPI(thi
s._commandLineAPIImpl, isEvalOnCallFrame ? object : null); | 646 inspectedWindow.console._commandLineAPI = new CommandLineAPI(thi
s._commandLineAPIImpl, isEvalOnCallFrame ? object : null); |
| 639 expression = "with ((console && console._commandLineAPI) || { __
proto__: null }) {\n" + expression + "\n}"; | 647 prefix = "with ((console && console._commandLineAPI) || { __prot
o__: null }) {"; |
| 648 suffix = "}"; |
| 640 } | 649 } |
| 650 if (injectScopeChain && inspectedWindow.console) { |
| 651 inspectedWindow.console._scopeChainForEval = scopeChain; |
| 652 for (var i = 0; i < scopeChain.length; ++i) { |
| 653 prefix = "with ((console && console._scopeChainForEval[" + i
+ "]) || { __proto__: null }) {" + (suffix ? " " : "") + prefix; |
| 654 if (suffix) |
| 655 suffix += " }"; |
| 656 else |
| 657 suffix = "}"; |
| 658 } |
| 659 } |
| 660 |
| 661 if (prefix) |
| 662 expression = prefix + "\n" + expression + "\n" + suffix; |
| 641 var result = evalFunction.call(object, expression); | 663 var result = evalFunction.call(object, expression); |
| 642 if (objectGroup === "console") | 664 if (objectGroup === "console") |
| 643 this._lastResult = result; | 665 this._lastResult = result; |
| 644 return result; | 666 return result; |
| 645 } finally { | 667 } finally { |
| 646 if (injectCommandLineAPI && inspectedWindow.console) | 668 if (injectCommandLineAPI && inspectedWindow.console) |
| 647 delete inspectedWindow.console._commandLineAPI; | 669 delete inspectedWindow.console._commandLineAPI; |
| 670 if (injectScopeChain && inspectedWindow.console) |
| 671 delete inspectedWindow.console._scopeChainForEval; |
| 648 } | 672 } |
| 649 }, | 673 }, |
| 650 | 674 |
| 651 /** | 675 /** |
| 652 * @param {Object} callFrame | 676 * @param {?Object} callFrame |
| 653 * @return {!Array.<InjectedScript.CallFrameProxy>|boolean} | 677 * @param {number} asyncOrdinal |
| 678 * @return {!Array.<!InjectedScript.CallFrameProxy>|boolean} |
| 654 */ | 679 */ |
| 655 wrapCallFrames: function(callFrame) | 680 wrapCallFrames: function(callFrame, asyncOrdinal) |
| 656 { | 681 { |
| 657 if (!callFrame) | 682 if (!callFrame) |
| 658 return false; | 683 return false; |
| 659 | 684 |
| 660 var result = []; | 685 var result = []; |
| 661 var depth = 0; | 686 var depth = 0; |
| 662 do { | 687 do { |
| 663 result.push(new InjectedScript.CallFrameProxy(depth++, callFrame)); | 688 result.push(new InjectedScript.CallFrameProxy(depth++, callFrame, as
yncOrdinal)); |
| 664 callFrame = callFrame.caller; | 689 callFrame = callFrame.caller; |
| 665 } while (callFrame); | 690 } while (callFrame); |
| 666 return result; | 691 return result; |
| 667 }, | 692 }, |
| 668 | 693 |
| 669 /** | 694 /** |
| 670 * @param {Object} topCallFrame | 695 * @param {!Object} topCallFrame |
| 696 * @param {!Array.<!Object>} asyncCallStacks |
| 671 * @param {string} callFrameId | 697 * @param {string} callFrameId |
| 672 * @param {string} expression | 698 * @param {string} expression |
| 673 * @param {string} objectGroup | 699 * @param {string} objectGroup |
| 674 * @param {boolean} injectCommandLineAPI | 700 * @param {boolean} injectCommandLineAPI |
| 675 * @param {boolean} returnByValue | 701 * @param {boolean} returnByValue |
| 676 * @param {boolean} generatePreview | 702 * @param {boolean} generatePreview |
| 677 * @return {*} | 703 * @return {*} |
| 678 */ | 704 */ |
| 679 evaluateOnCallFrame: function(topCallFrame, callFrameId, expression, objectG
roup, injectCommandLineAPI, returnByValue, generatePreview) | 705 evaluateOnCallFrame: function(topCallFrame, asyncCallStacks, callFrameId, ex
pression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview) |
| 680 { | 706 { |
| 681 var callFrame = this.callFrameForId(topCallFrame, callFrameId); | 707 var parsedCallFrameId = nullifyObjectProto(InjectedScriptHost.evaluate("
(" + callFrameId + ")")); |
| 708 var callFrame = this._callFrameForParsedId(topCallFrame, parsedCallFrame
Id, asyncCallStacks); |
| 682 if (!callFrame) | 709 if (!callFrame) |
| 683 return "Could not find call frame with given id"; | 710 return "Could not find call frame with given id"; |
| 711 if (parsedCallFrameId["asyncOrdinal"]) |
| 712 return this._evaluateAndWrap(InjectedScriptHost.evaluate, InjectedSc
riptHost, expression, objectGroup, false, injectCommandLineAPI, returnByValue, g
eneratePreview, callFrame.scopeChain); |
| 684 return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression,
objectGroup, true, injectCommandLineAPI, returnByValue, generatePreview); | 713 return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression,
objectGroup, true, injectCommandLineAPI, returnByValue, generatePreview); |
| 685 }, | 714 }, |
| 686 | 715 |
| 687 /** | 716 /** |
| 688 * @param {Object} topCallFrame | 717 * @param {!Object} topCallFrame |
| 689 * @param {string} callFrameId | 718 * @param {string} callFrameId |
| 690 * @return {*} | 719 * @return {*} |
| 691 */ | 720 */ |
| 692 restartFrame: function(topCallFrame, callFrameId) | 721 restartFrame: function(topCallFrame, callFrameId) |
| 693 { | 722 { |
| 694 var callFrame = this.callFrameForId(topCallFrame, callFrameId); | 723 var callFrame = this.callFrameForId(topCallFrame, callFrameId); |
| 695 if (!callFrame) | 724 if (!callFrame) |
| 696 return "Could not find call frame with given id"; | 725 return "Could not find call frame with given id"; |
| 697 var result = callFrame.restart(); | 726 var result = callFrame.restart(); |
| 698 if (result === false) | 727 if (result === false) |
| 699 result = "Restart frame is not supported"; | 728 result = "Restart frame is not supported"; |
| 700 return result; | 729 return result; |
| 701 }, | 730 }, |
| 702 | 731 |
| 703 /** | 732 /** |
| 704 * @param {Object} topCallFrame | 733 * @param {!Object} topCallFrame |
| 705 * @param {string} callFrameId | 734 * @param {string} callFrameId |
| 706 * @return {*} a stepIn position array ready for protocol JSON or a string e
rror | 735 * @return {*} a stepIn position array ready for protocol JSON or a string e
rror |
| 707 */ | 736 */ |
| 708 getStepInPositions: function(topCallFrame, callFrameId) | 737 getStepInPositions: function(topCallFrame, callFrameId) |
| 709 { | 738 { |
| 710 var callFrame = this.callFrameForId(topCallFrame, callFrameId); | 739 var callFrame = this.callFrameForId(topCallFrame, callFrameId); |
| 711 if (!callFrame) | 740 if (!callFrame) |
| 712 return "Could not find call frame with given id"; | 741 return "Could not find call frame with given id"; |
| 713 var stepInPositionsUnpacked = JSON.parse(callFrame.stepInPositions); | 742 var stepInPositionsUnpacked = JSON.parse(callFrame.stepInPositions); |
| 714 if (typeof stepInPositionsUnpacked !== "object") | 743 if (typeof stepInPositionsUnpacked !== "object") |
| 715 return "Step in positions not available"; | 744 return "Step in positions not available"; |
| 716 return stepInPositionsUnpacked; | 745 return stepInPositionsUnpacked; |
| 717 }, | 746 }, |
| 718 | 747 |
| 719 /** | 748 /** |
| 720 * Either callFrameId or functionObjectId must be specified. | 749 * Either callFrameId or functionObjectId must be specified. |
| 721 * @param {Object} topCallFrame | 750 * @param {!Object} topCallFrame |
| 722 * @param {string|boolean} callFrameId or false | 751 * @param {string|boolean} callFrameId or false |
| 723 * @param {string|boolean} functionObjectId or false | 752 * @param {string|boolean} functionObjectId or false |
| 724 * @param {number} scopeNumber | 753 * @param {number} scopeNumber |
| 725 * @param {string} variableName | 754 * @param {string} variableName |
| 726 * @param {string} newValueJsonString RuntimeAgent.CallArgument structure se
rialized as string | 755 * @param {string} newValueJsonString RuntimeAgent.CallArgument structure se
rialized as string |
| 727 * @return {string|undefined} undefined if success or an error message | 756 * @return {string|undefined} undefined if success or an error message |
| 728 */ | 757 */ |
| 729 setVariableValue: function(topCallFrame, callFrameId, functionObjectId, scop
eNumber, variableName, newValueJsonString) | 758 setVariableValue: function(topCallFrame, callFrameId, functionObjectId, scop
eNumber, variableName, newValueJsonString) |
| 730 { | 759 { |
| 731 var setter; | 760 var setter; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 755 } | 784 } |
| 756 try { | 785 try { |
| 757 setter(scopeNumber, variableName, resolvedValue); | 786 setter(scopeNumber, variableName, resolvedValue); |
| 758 } catch (e) { | 787 } catch (e) { |
| 759 return "Failed to change variable value: " + e; | 788 return "Failed to change variable value: " + e; |
| 760 } | 789 } |
| 761 return undefined; | 790 return undefined; |
| 762 }, | 791 }, |
| 763 | 792 |
| 764 /** | 793 /** |
| 765 * @param {Object} topCallFrame | 794 * @param {!Object} topCallFrame |
| 766 * @param {string} callFrameId | 795 * @param {string} callFrameId |
| 767 * @return {Object} | 796 * @return {?Object} |
| 768 */ | 797 */ |
| 769 callFrameForId: function(topCallFrame, callFrameId) | 798 callFrameForId: function(topCallFrame, callFrameId) |
| 770 { | 799 { |
| 771 var parsedCallFrameId = nullifyObjectProto(InjectedScriptHost.evaluate("
(" + callFrameId + ")")); | 800 var parsedCallFrameId = nullifyObjectProto(InjectedScriptHost.evaluate("
(" + callFrameId + ")")); |
| 801 return this._callFrameForParsedId(topCallFrame, parsedCallFrameId, []); |
| 802 }, |
| 803 |
| 804 /** |
| 805 * @param {!Object} topCallFrame |
| 806 * @param {!Object} parsedCallFrameId |
| 807 * @param {!Array.<!Object>} asyncCallStacks |
| 808 * @return {?Object} |
| 809 */ |
| 810 _callFrameForParsedId: function(topCallFrame, parsedCallFrameId, asyncCallSt
acks) |
| 811 { |
| 812 var asyncOrdinal = parsedCallFrameId["asyncOrdinal"]; // 1-based index |
| 813 if (asyncOrdinal) |
| 814 topCallFrame = asyncCallStacks[asyncOrdinal - 1]; |
| 772 var ordinal = parsedCallFrameId["ordinal"]; | 815 var ordinal = parsedCallFrameId["ordinal"]; |
| 773 var callFrame = topCallFrame; | 816 var callFrame = topCallFrame; |
| 774 while (--ordinal >= 0 && callFrame) | 817 while (--ordinal >= 0 && callFrame) |
| 775 callFrame = callFrame.caller; | 818 callFrame = callFrame.caller; |
| 776 return callFrame; | 819 return callFrame; |
| 777 }, | 820 }, |
| 778 | 821 |
| 779 /** | 822 /** |
| 780 * @param {Object} objectId | 823 * @param {Object} objectId |
| 781 * @return {Object} | 824 * @return {Object} |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 } | 1184 } |
| 1142 return string.substr(0, maxLength) + "\u2026"; | 1185 return string.substr(0, maxLength) + "\u2026"; |
| 1143 }, | 1186 }, |
| 1144 | 1187 |
| 1145 __proto__: null | 1188 __proto__: null |
| 1146 } | 1189 } |
| 1147 /** | 1190 /** |
| 1148 * @constructor | 1191 * @constructor |
| 1149 * @param {number} ordinal | 1192 * @param {number} ordinal |
| 1150 * @param {!Object} callFrame | 1193 * @param {!Object} callFrame |
| 1194 * @param {number} asyncOrdinal |
| 1151 */ | 1195 */ |
| 1152 InjectedScript.CallFrameProxy = function(ordinal, callFrame) | 1196 InjectedScript.CallFrameProxy = function(ordinal, callFrame, asyncOrdinal) |
| 1153 { | 1197 { |
| 1154 this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + in
jectedScriptId + "}"; | 1198 this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + in
jectedScriptId + (asyncOrdinal ? ",\"asyncOrdinal\":" + asyncOrdinal : "") + "}"
; |
| 1155 this.functionName = (callFrame.type === "function" ? callFrame.functionName
: ""); | 1199 this.functionName = (callFrame.type === "function" ? callFrame.functionName
: ""); |
| 1156 this.location = { scriptId: toString(callFrame.sourceID), lineNumber: callFr
ame.line, columnNumber: callFrame.column, __proto__: null }; | 1200 this.location = { scriptId: toString(callFrame.sourceID), lineNumber: callFr
ame.line, columnNumber: callFrame.column, __proto__: null }; |
| 1157 this.scopeChain = this._wrapScopeChain(callFrame); | 1201 this.scopeChain = this._wrapScopeChain(callFrame); |
| 1158 this.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); | 1202 this.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace"); |
| 1159 if (callFrame.isAtReturn) | 1203 if (callFrame.isAtReturn) |
| 1160 this.returnValue = injectedScript._wrapObject(callFrame.returnValue, "ba
cktrace"); | 1204 this.returnValue = injectedScript._wrapObject(callFrame.returnValue, "ba
cktrace"); |
| 1161 } | 1205 } |
| 1162 | 1206 |
| 1163 InjectedScript.CallFrameProxy.prototype = { | 1207 InjectedScript.CallFrameProxy.prototype = { |
| 1164 /** | 1208 /** |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1178 | 1222 |
| 1179 __proto__: null | 1223 __proto__: null |
| 1180 } | 1224 } |
| 1181 | 1225 |
| 1182 /** | 1226 /** |
| 1183 * @param {number} scopeTypeCode | 1227 * @param {number} scopeTypeCode |
| 1184 * @param {*} scopeObject | 1228 * @param {*} scopeObject |
| 1185 * @param {string} groupId | 1229 * @param {string} groupId |
| 1186 * @return {!DebuggerAgent.Scope} | 1230 * @return {!DebuggerAgent.Scope} |
| 1187 */ | 1231 */ |
| 1188 InjectedScript.CallFrameProxy._createScopeJson = function(scopeTypeCode, scopeOb
ject, groupId) { | 1232 InjectedScript.CallFrameProxy._createScopeJson = function(scopeTypeCode, scopeOb
ject, groupId) |
| 1233 { |
| 1189 const GLOBAL_SCOPE = 0; | 1234 const GLOBAL_SCOPE = 0; |
| 1190 const LOCAL_SCOPE = 1; | 1235 const LOCAL_SCOPE = 1; |
| 1191 const WITH_SCOPE = 2; | 1236 const WITH_SCOPE = 2; |
| 1192 const CLOSURE_SCOPE = 3; | 1237 const CLOSURE_SCOPE = 3; |
| 1193 const CATCH_SCOPE = 4; | 1238 const CATCH_SCOPE = 4; |
| 1194 | 1239 |
| 1195 /** @type {!Object.<number, string>} */ | 1240 /** @type {!Object.<number, string>} */ |
| 1196 var scopeTypeNames = { __proto__: null }; | 1241 var scopeTypeNames = { __proto__: null }; |
| 1197 scopeTypeNames[GLOBAL_SCOPE] = "global"; | 1242 scopeTypeNames[GLOBAL_SCOPE] = "global"; |
| 1198 scopeTypeNames[LOCAL_SCOPE] = "local"; | 1243 scopeTypeNames[LOCAL_SCOPE] = "local"; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 undebug: function(fn) | 1523 undebug: function(fn) |
| 1479 { | 1524 { |
| 1480 InjectedScriptHost.undebugFunction(fn); | 1525 InjectedScriptHost.undebugFunction(fn); |
| 1481 }, | 1526 }, |
| 1482 | 1527 |
| 1483 monitor: function(fn) | 1528 monitor: function(fn) |
| 1484 { | 1529 { |
| 1485 InjectedScriptHost.monitorFunction(fn); | 1530 InjectedScriptHost.monitorFunction(fn); |
| 1486 }, | 1531 }, |
| 1487 | 1532 |
| 1488 unmonitor: function(fn) { | 1533 unmonitor: function(fn) |
| 1534 { |
| 1489 InjectedScriptHost.unmonitorFunction(fn); | 1535 InjectedScriptHost.unmonitorFunction(fn); |
| 1490 }, | 1536 }, |
| 1491 | 1537 |
| 1492 table: function(data, opt_columns) | 1538 table: function(data, opt_columns) |
| 1493 { | 1539 { |
| 1494 inspectedWindow.console.table.apply(inspectedWindow.console, arguments); | 1540 inspectedWindow.console.table.apply(inspectedWindow.console, arguments); |
| 1495 }, | 1541 }, |
| 1496 | 1542 |
| 1497 /** | 1543 /** |
| 1498 * @param {number} num | 1544 * @param {number} num |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 */ | 1580 */ |
| 1535 _logEvent: function(event) | 1581 _logEvent: function(event) |
| 1536 { | 1582 { |
| 1537 inspectedWindow.console.log(event.type, event); | 1583 inspectedWindow.console.log(event.type, event); |
| 1538 } | 1584 } |
| 1539 } | 1585 } |
| 1540 | 1586 |
| 1541 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1587 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
| 1542 return injectedScript; | 1588 return injectedScript; |
| 1543 }) | 1589 }) |
| OLD | NEW |