OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 /** @type {!WebInspector.Object} */ | 50 /** @type {!WebInspector.Object} */ |
51 this._breakpointResolvedEventTarget = new WebInspector.Object(); | 51 this._breakpointResolvedEventTarget = new WebInspector.Object(); |
52 | 52 |
53 this._isPausing = false; | 53 this._isPausing = false; |
54 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this
._pauseOnExceptionStateChanged, this); | 54 WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this
._pauseOnExceptionStateChanged, this); |
55 WebInspector.moduleSetting("pauseOnCaughtException").addChangeListener(this.
_pauseOnExceptionStateChanged, this); | 55 WebInspector.moduleSetting("pauseOnCaughtException").addChangeListener(this.
_pauseOnExceptionStateChanged, this); |
56 WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this.
asyncStackTracesStateChanged, this); | 56 WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this.
asyncStackTracesStateChanged, this); |
57 | 57 |
58 this.enableDebugger(); | 58 this.enableDebugger(); |
59 } | 59 }; |
60 | 60 |
61 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, functionName: str
ing}} */ | 61 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, functionName: str
ing}} */ |
62 WebInspector.DebuggerModel.FunctionDetails; | 62 WebInspector.DebuggerModel.FunctionDetails; |
63 | 63 |
64 /** | 64 /** |
65 * Keep these in sync with WebCore::V8Debugger | 65 * Keep these in sync with WebCore::V8Debugger |
66 * | 66 * |
67 * @enum {string} | 67 * @enum {string} |
68 */ | 68 */ |
69 WebInspector.DebuggerModel.PauseOnExceptionsState = { | 69 WebInspector.DebuggerModel.PauseOnExceptionsState = { |
70 DontPauseOnExceptions : "none", | 70 DontPauseOnExceptions : "none", |
71 PauseOnAllExceptions : "all", | 71 PauseOnAllExceptions : "all", |
72 PauseOnUncaughtExceptions: "uncaught" | 72 PauseOnUncaughtExceptions: "uncaught" |
73 }; | 73 }; |
74 | 74 |
75 /** @enum {symbol} */ | 75 /** @enum {symbol} */ |
76 WebInspector.DebuggerModel.Events = { | 76 WebInspector.DebuggerModel.Events = { |
77 DebuggerWasEnabled: Symbol("DebuggerWasEnabled"), | 77 DebuggerWasEnabled: Symbol("DebuggerWasEnabled"), |
78 DebuggerWasDisabled: Symbol("DebuggerWasDisabled"), | 78 DebuggerWasDisabled: Symbol("DebuggerWasDisabled"), |
79 BeforeDebuggerPaused: Symbol("BeforeDebuggerPaused"), | 79 BeforeDebuggerPaused: Symbol("BeforeDebuggerPaused"), |
80 DebuggerPaused: Symbol("DebuggerPaused"), | 80 DebuggerPaused: Symbol("DebuggerPaused"), |
81 DebuggerResumed: Symbol("DebuggerResumed"), | 81 DebuggerResumed: Symbol("DebuggerResumed"), |
82 ParsedScriptSource: Symbol("ParsedScriptSource"), | 82 ParsedScriptSource: Symbol("ParsedScriptSource"), |
83 FailedToParseScriptSource: Symbol("FailedToParseScriptSource"), | 83 FailedToParseScriptSource: Symbol("FailedToParseScriptSource"), |
84 GlobalObjectCleared: Symbol("GlobalObjectCleared"), | 84 GlobalObjectCleared: Symbol("GlobalObjectCleared"), |
85 CallFrameSelected: Symbol("CallFrameSelected"), | 85 CallFrameSelected: Symbol("CallFrameSelected"), |
86 ConsoleCommandEvaluatedInSelectedCallFrame: Symbol("ConsoleCommandEvaluatedI
nSelectedCallFrame") | 86 ConsoleCommandEvaluatedInSelectedCallFrame: Symbol("ConsoleCommandEvaluatedI
nSelectedCallFrame") |
87 } | 87 }; |
88 | 88 |
89 /** @enum {string} */ | 89 /** @enum {string} */ |
90 WebInspector.DebuggerModel.BreakReason = { | 90 WebInspector.DebuggerModel.BreakReason = { |
91 DOM: "DOM", | 91 DOM: "DOM", |
92 EventListener: "EventListener", | 92 EventListener: "EventListener", |
93 XHR: "XHR", | 93 XHR: "XHR", |
94 Exception: "exception", | 94 Exception: "exception", |
95 PromiseRejection: "promiseRejection", | 95 PromiseRejection: "promiseRejection", |
96 Assert: "assert", | 96 Assert: "assert", |
97 DebugCommand: "debugCommand", | 97 DebugCommand: "debugCommand", |
98 Other: "other" | 98 Other: "other" |
99 } | 99 }; |
100 | 100 |
101 WebInspector.DebuggerModel.prototype = { | 101 WebInspector.DebuggerModel.prototype = { |
102 /** | 102 /** |
103 * @return {boolean} | 103 * @return {boolean} |
104 */ | 104 */ |
105 debuggerEnabled: function() | 105 debuggerEnabled: function() |
106 { | 106 { |
107 return !!this._debuggerEnabled; | 107 return !!this._debuggerEnabled; |
108 }, | 108 }, |
109 | 109 |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 } | 706 } |
707 }, | 707 }, |
708 | 708 |
709 /** | 709 /** |
710 * @param {!DebuggerAgent.BreakpointId} breakpointId | 710 * @param {!DebuggerAgent.BreakpointId} breakpointId |
711 * @param {function(!WebInspector.Event)} listener | 711 * @param {function(!WebInspector.Event)} listener |
712 * @param {!Object=} thisObject | 712 * @param {!Object=} thisObject |
713 */ | 713 */ |
714 addBreakpointListener: function(breakpointId, listener, thisObject) | 714 addBreakpointListener: function(breakpointId, listener, thisObject) |
715 { | 715 { |
716 this._breakpointResolvedEventTarget.addEventListener(breakpointId, liste
ner, thisObject) | 716 this._breakpointResolvedEventTarget.addEventListener(breakpointId, liste
ner, thisObject); |
717 }, | 717 }, |
718 | 718 |
719 /** | 719 /** |
720 * @param {!DebuggerAgent.BreakpointId} breakpointId | 720 * @param {!DebuggerAgent.BreakpointId} breakpointId |
721 * @param {function(!WebInspector.Event)} listener | 721 * @param {function(!WebInspector.Event)} listener |
722 * @param {!Object=} thisObject | 722 * @param {!Object=} thisObject |
723 */ | 723 */ |
724 removeBreakpointListener: function(breakpointId, listener, thisObject) | 724 removeBreakpointListener: function(breakpointId, listener, thisObject) |
725 { | 725 { |
726 this._breakpointResolvedEventTarget.removeEventListener(breakpointId, li
stener, thisObject); | 726 this._breakpointResolvedEventTarget.removeEventListener(breakpointId, li
stener, thisObject); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 * @param {function()} fulfill | 785 * @param {function()} fulfill |
786 * @this {WebInspector.DebuggerModel} | 786 * @this {WebInspector.DebuggerModel} |
787 */ | 787 */ |
788 function promiseBody(fulfill) | 788 function promiseBody(fulfill) |
789 { | 789 { |
790 this.enableDebugger(fulfill); | 790 this.enableDebugger(fulfill); |
791 } | 791 } |
792 }, | 792 }, |
793 | 793 |
794 __proto__: WebInspector.SDKModel.prototype | 794 __proto__: WebInspector.SDKModel.prototype |
795 } | 795 }; |
796 | 796 |
797 WebInspector.DebuggerEventTypes = { | 797 WebInspector.DebuggerEventTypes = { |
798 JavaScriptPause: 0, | 798 JavaScriptPause: 0, |
799 JavaScriptBreakpoint: 1, | 799 JavaScriptBreakpoint: 1, |
800 NativeBreakpoint: 2 | 800 NativeBreakpoint: 2 |
801 }; | 801 }; |
802 | 802 |
803 /** | 803 /** |
804 * @constructor | 804 * @constructor |
805 * @implements {DebuggerAgent.Dispatcher} | 805 * @implements {DebuggerAgent.Dispatcher} |
806 * @param {!WebInspector.DebuggerModel} debuggerModel | 806 * @param {!WebInspector.DebuggerModel} debuggerModel |
807 */ | 807 */ |
808 WebInspector.DebuggerDispatcher = function(debuggerModel) | 808 WebInspector.DebuggerDispatcher = function(debuggerModel) |
809 { | 809 { |
810 this._debuggerModel = debuggerModel; | 810 this._debuggerModel = debuggerModel; |
811 } | 811 }; |
812 | 812 |
813 WebInspector.DebuggerDispatcher.prototype = { | 813 WebInspector.DebuggerDispatcher.prototype = { |
814 /** | 814 /** |
815 * @override | 815 * @override |
816 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames | 816 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames |
817 * @param {string} reason | 817 * @param {string} reason |
818 * @param {!Object=} auxData | 818 * @param {!Object=} auxData |
819 * @param {!Array.<string>=} breakpointIds | 819 * @param {!Array.<string>=} breakpointIds |
820 * @param {!RuntimeAgent.StackTrace=} asyncStackTrace | 820 * @param {!RuntimeAgent.StackTrace=} asyncStackTrace |
821 */ | 821 */ |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 | 873 |
874 /** | 874 /** |
875 * @override | 875 * @override |
876 * @param {!DebuggerAgent.BreakpointId} breakpointId | 876 * @param {!DebuggerAgent.BreakpointId} breakpointId |
877 * @param {!DebuggerAgent.Location} location | 877 * @param {!DebuggerAgent.Location} location |
878 */ | 878 */ |
879 breakpointResolved: function(breakpointId, location) | 879 breakpointResolved: function(breakpointId, location) |
880 { | 880 { |
881 this._debuggerModel._breakpointResolved(breakpointId, location); | 881 this._debuggerModel._breakpointResolved(breakpointId, location); |
882 } | 882 } |
883 } | 883 }; |
884 | 884 |
885 /** | 885 /** |
886 * @constructor | 886 * @constructor |
887 * @extends {WebInspector.SDKObject} | 887 * @extends {WebInspector.SDKObject} |
888 * @param {!WebInspector.DebuggerModel} debuggerModel | 888 * @param {!WebInspector.DebuggerModel} debuggerModel |
889 * @param {string} scriptId | 889 * @param {string} scriptId |
890 * @param {number} lineNumber | 890 * @param {number} lineNumber |
891 * @param {number=} columnNumber | 891 * @param {number=} columnNumber |
892 */ | 892 */ |
893 WebInspector.DebuggerModel.Location = function(debuggerModel, scriptId, lineNumb
er, columnNumber) | 893 WebInspector.DebuggerModel.Location = function(debuggerModel, scriptId, lineNumb
er, columnNumber) |
894 { | 894 { |
895 WebInspector.SDKObject.call(this, debuggerModel.target()); | 895 WebInspector.SDKObject.call(this, debuggerModel.target()); |
896 this._debuggerModel = debuggerModel; | 896 this._debuggerModel = debuggerModel; |
897 this.scriptId = scriptId; | 897 this.scriptId = scriptId; |
898 this.lineNumber = lineNumber; | 898 this.lineNumber = lineNumber; |
899 this.columnNumber = columnNumber || 0; | 899 this.columnNumber = columnNumber || 0; |
900 } | 900 }; |
901 | 901 |
902 /** | 902 /** |
903 * @param {!WebInspector.DebuggerModel} debuggerModel | 903 * @param {!WebInspector.DebuggerModel} debuggerModel |
904 * @param {!DebuggerAgent.Location} payload | 904 * @param {!DebuggerAgent.Location} payload |
905 * @return {!WebInspector.DebuggerModel.Location} | 905 * @return {!WebInspector.DebuggerModel.Location} |
906 */ | 906 */ |
907 WebInspector.DebuggerModel.Location.fromPayload = function(debuggerModel, payloa
d) | 907 WebInspector.DebuggerModel.Location.fromPayload = function(debuggerModel, payloa
d) |
908 { | 908 { |
909 return new WebInspector.DebuggerModel.Location(debuggerModel, payload.script
Id, payload.lineNumber, payload.columnNumber); | 909 return new WebInspector.DebuggerModel.Location(debuggerModel, payload.script
Id, payload.lineNumber, payload.columnNumber); |
910 } | 910 }; |
911 | 911 |
912 WebInspector.DebuggerModel.Location.prototype = { | 912 WebInspector.DebuggerModel.Location.prototype = { |
913 /** | 913 /** |
914 * @return {!DebuggerAgent.Location} | 914 * @return {!DebuggerAgent.Location} |
915 */ | 915 */ |
916 payload: function() | 916 payload: function() |
917 { | 917 { |
918 return { scriptId: this.scriptId, lineNumber: this.lineNumber, columnNum
ber: this.columnNumber }; | 918 return { scriptId: this.scriptId, lineNumber: this.lineNumber, columnNum
ber: this.columnNumber }; |
919 }, | 919 }, |
920 | 920 |
(...skipping 12 matching lines...) Expand all Loading... |
933 | 933 |
934 /** | 934 /** |
935 * @return {string} | 935 * @return {string} |
936 */ | 936 */ |
937 id: function() | 937 id: function() |
938 { | 938 { |
939 return this.target().id() + ":" + this.scriptId + ":" + this.lineNumber
+ ":" + this.columnNumber; | 939 return this.target().id() + ":" + this.scriptId + ":" + this.lineNumber
+ ":" + this.columnNumber; |
940 }, | 940 }, |
941 | 941 |
942 __proto__: WebInspector.SDKObject.prototype | 942 __proto__: WebInspector.SDKObject.prototype |
943 } | 943 }; |
944 | 944 |
945 /** | 945 /** |
946 * @constructor | 946 * @constructor |
947 * @extends {WebInspector.SDKObject} | 947 * @extends {WebInspector.SDKObject} |
948 * @param {!WebInspector.DebuggerModel} debuggerModel | 948 * @param {!WebInspector.DebuggerModel} debuggerModel |
949 * @param {!WebInspector.Script} script | 949 * @param {!WebInspector.Script} script |
950 * @param {!DebuggerAgent.CallFrame} payload | 950 * @param {!DebuggerAgent.CallFrame} payload |
951 */ | 951 */ |
952 WebInspector.DebuggerModel.CallFrame = function(debuggerModel, script, payload) | 952 WebInspector.DebuggerModel.CallFrame = function(debuggerModel, script, payload) |
953 { | 953 { |
954 var target = debuggerModel.target(); | 954 var target = debuggerModel.target(); |
955 WebInspector.SDKObject.call(this, target); | 955 WebInspector.SDKObject.call(this, target); |
956 this.debuggerModel = debuggerModel; | 956 this.debuggerModel = debuggerModel; |
957 this._debuggerAgent = debuggerModel._agent; | 957 this._debuggerAgent = debuggerModel._agent; |
958 this._script = script; | 958 this._script = script; |
959 this._payload = payload; | 959 this._payload = payload; |
960 this._location = WebInspector.DebuggerModel.Location.fromPayload(debuggerMod
el, payload.location); | 960 this._location = WebInspector.DebuggerModel.Location.fromPayload(debuggerMod
el, payload.location); |
961 this._scopeChain = []; | 961 this._scopeChain = []; |
962 this._localScope = null; | 962 this._localScope = null; |
963 for (var i = 0; i < payload.scopeChain.length; ++i) { | 963 for (var i = 0; i < payload.scopeChain.length; ++i) { |
964 var scope = new WebInspector.DebuggerModel.Scope(this, i); | 964 var scope = new WebInspector.DebuggerModel.Scope(this, i); |
965 this._scopeChain.push(scope); | 965 this._scopeChain.push(scope); |
966 if (scope.type() === DebuggerAgent.ScopeType.Local) | 966 if (scope.type() === DebuggerAgent.ScopeType.Local) |
967 this._localScope = scope; | 967 this._localScope = scope; |
968 } | 968 } |
969 if (payload.functionLocation) | 969 if (payload.functionLocation) |
970 this._functionLocation = WebInspector.DebuggerModel.Location.fromPayload
(debuggerModel, payload.functionLocation); | 970 this._functionLocation = WebInspector.DebuggerModel.Location.fromPayload
(debuggerModel, payload.functionLocation); |
971 } | 971 }; |
972 | 972 |
973 /** | 973 /** |
974 * @param {!WebInspector.DebuggerModel} debuggerModel | 974 * @param {!WebInspector.DebuggerModel} debuggerModel |
975 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames | 975 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames |
976 * @return {!Array.<!WebInspector.DebuggerModel.CallFrame>} | 976 * @return {!Array.<!WebInspector.DebuggerModel.CallFrame>} |
977 */ | 977 */ |
978 WebInspector.DebuggerModel.CallFrame.fromPayloadArray = function(debuggerModel,
callFrames) | 978 WebInspector.DebuggerModel.CallFrame.fromPayloadArray = function(debuggerModel,
callFrames) |
979 { | 979 { |
980 var result = []; | 980 var result = []; |
981 for (var i = 0; i < callFrames.length; ++i) { | 981 for (var i = 0; i < callFrames.length; ++i) { |
982 var callFrame = callFrames[i]; | 982 var callFrame = callFrames[i]; |
983 var script = debuggerModel.scriptForId(callFrame.location.scriptId); | 983 var script = debuggerModel.scriptForId(callFrame.location.scriptId); |
984 if (script) | 984 if (script) |
985 result.push(new WebInspector.DebuggerModel.CallFrame(debuggerModel,
script, callFrame)); | 985 result.push(new WebInspector.DebuggerModel.CallFrame(debuggerModel,
script, callFrame)); |
986 } | 986 } |
987 return result; | 987 return result; |
988 } | 988 }; |
989 | 989 |
990 WebInspector.DebuggerModel.CallFrame.prototype = { | 990 WebInspector.DebuggerModel.CallFrame.prototype = { |
991 /** | 991 /** |
992 * @return {!WebInspector.Script} | 992 * @return {!WebInspector.Script} |
993 */ | 993 */ |
994 get script() | 994 get script() |
995 { | 995 { |
996 return this._script; | 996 return this._script; |
997 }, | 997 }, |
998 | 998 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 var scopeChain = this.scopeChain(); | 1127 var scopeChain = this.scopeChain(); |
1128 var pendingRequests = scopeChain.length; | 1128 var pendingRequests = scopeChain.length; |
1129 for (var i = 0; i < scopeChain.length; ++i) { | 1129 for (var i = 0; i < scopeChain.length; ++i) { |
1130 var scope = scopeChain[i]; | 1130 var scope = scopeChain[i]; |
1131 var object = scope.object(); | 1131 var object = scope.object(); |
1132 object.getAllProperties(false, propertiesCollected); | 1132 object.getAllProperties(false, propertiesCollected); |
1133 } | 1133 } |
1134 }, | 1134 }, |
1135 | 1135 |
1136 __proto__: WebInspector.SDKObject.prototype | 1136 __proto__: WebInspector.SDKObject.prototype |
1137 } | 1137 }; |
1138 | 1138 |
1139 /** | 1139 /** |
1140 * @constructor | 1140 * @constructor |
1141 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame | 1141 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame |
1142 * @param {number} ordinal | 1142 * @param {number} ordinal |
1143 */ | 1143 */ |
1144 WebInspector.DebuggerModel.Scope = function(callFrame, ordinal) | 1144 WebInspector.DebuggerModel.Scope = function(callFrame, ordinal) |
1145 { | 1145 { |
1146 this._callFrame = callFrame; | 1146 this._callFrame = callFrame; |
1147 this._payload = callFrame._payload.scopeChain[ordinal]; | 1147 this._payload = callFrame._payload.scopeChain[ordinal]; |
1148 this._type = this._payload.type; | 1148 this._type = this._payload.type; |
1149 this._name = this._payload.name; | 1149 this._name = this._payload.name; |
1150 this._ordinal = ordinal; | 1150 this._ordinal = ordinal; |
1151 this._startLocation = this._payload.startLocation ? WebInspector.DebuggerMod
el.Location.fromPayload(callFrame.debuggerModel, this._payload.startLocation) :
null; | 1151 this._startLocation = this._payload.startLocation ? WebInspector.DebuggerMod
el.Location.fromPayload(callFrame.debuggerModel, this._payload.startLocation) :
null; |
1152 this._endLocation = this._payload.endLocation ? WebInspector.DebuggerModel.L
ocation.fromPayload(callFrame.debuggerModel, this._payload.endLocation) : null; | 1152 this._endLocation = this._payload.endLocation ? WebInspector.DebuggerModel.L
ocation.fromPayload(callFrame.debuggerModel, this._payload.endLocation) : null; |
1153 } | 1153 }; |
1154 | 1154 |
1155 WebInspector.DebuggerModel.Scope.prototype = { | 1155 WebInspector.DebuggerModel.Scope.prototype = { |
1156 /** | 1156 /** |
1157 * @return {!WebInspector.DebuggerModel.CallFrame} | 1157 * @return {!WebInspector.DebuggerModel.CallFrame} |
1158 */ | 1158 */ |
1159 callFrame: function() | 1159 callFrame: function() |
1160 { | 1160 { |
1161 return this._callFrame; | 1161 return this._callFrame; |
1162 }, | 1162 }, |
1163 | 1163 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 }, | 1212 }, |
1213 | 1213 |
1214 /** | 1214 /** |
1215 * @return {string} | 1215 * @return {string} |
1216 */ | 1216 */ |
1217 description: function() | 1217 description: function() |
1218 { | 1218 { |
1219 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; | 1219 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; |
1220 return declarativeScope ? "" : (this._payload.object.description || ""); | 1220 return declarativeScope ? "" : (this._payload.object.description || ""); |
1221 } | 1221 } |
1222 } | 1222 }; |
1223 | 1223 |
1224 /** | 1224 /** |
1225 * @constructor | 1225 * @constructor |
1226 * @extends {WebInspector.SDKObject} | 1226 * @extends {WebInspector.SDKObject} |
1227 * @param {!WebInspector.DebuggerModel} debuggerModel | 1227 * @param {!WebInspector.DebuggerModel} debuggerModel |
1228 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames | 1228 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames |
1229 * @param {string} reason | 1229 * @param {string} reason |
1230 * @param {!Object|undefined} auxData | 1230 * @param {!Object|undefined} auxData |
1231 * @param {!Array.<string>} breakpointIds | 1231 * @param {!Array.<string>} breakpointIds |
1232 * @param {!RuntimeAgent.StackTrace=} asyncStackTrace | 1232 * @param {!RuntimeAgent.StackTrace=} asyncStackTrace |
1233 */ | 1233 */ |
1234 WebInspector.DebuggerPausedDetails = function(debuggerModel, callFrames, reason,
auxData, breakpointIds, asyncStackTrace) | 1234 WebInspector.DebuggerPausedDetails = function(debuggerModel, callFrames, reason,
auxData, breakpointIds, asyncStackTrace) |
1235 { | 1235 { |
1236 WebInspector.SDKObject.call(this, debuggerModel.target()); | 1236 WebInspector.SDKObject.call(this, debuggerModel.target()); |
1237 this.debuggerModel = debuggerModel; | 1237 this.debuggerModel = debuggerModel; |
1238 this.callFrames = WebInspector.DebuggerModel.CallFrame.fromPayloadArray(debu
ggerModel, callFrames); | 1238 this.callFrames = WebInspector.DebuggerModel.CallFrame.fromPayloadArray(debu
ggerModel, callFrames); |
1239 this.reason = reason; | 1239 this.reason = reason; |
1240 this.auxData = auxData; | 1240 this.auxData = auxData; |
1241 this.breakpointIds = breakpointIds; | 1241 this.breakpointIds = breakpointIds; |
1242 if (asyncStackTrace) | 1242 if (asyncStackTrace) |
1243 this.asyncStackTrace = this._cleanRedundantFrames(asyncStackTrace); | 1243 this.asyncStackTrace = this._cleanRedundantFrames(asyncStackTrace); |
1244 } | 1244 }; |
1245 | 1245 |
1246 WebInspector.DebuggerPausedDetails.prototype = { | 1246 WebInspector.DebuggerPausedDetails.prototype = { |
1247 /** | 1247 /** |
1248 * @return {?WebInspector.RemoteObject} | 1248 * @return {?WebInspector.RemoteObject} |
1249 */ | 1249 */ |
1250 exception: function() | 1250 exception: function() |
1251 { | 1251 { |
1252 if (this.reason !== WebInspector.DebuggerModel.BreakReason.Exception &&
this.reason !== WebInspector.DebuggerModel.BreakReason.PromiseRejection) | 1252 if (this.reason !== WebInspector.DebuggerModel.BreakReason.Exception &&
this.reason !== WebInspector.DebuggerModel.BreakReason.PromiseRejection) |
1253 return null; | 1253 return null; |
1254 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime
Agent.RemoteObject} */(this.auxData)); | 1254 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime
Agent.RemoteObject} */(this.auxData)); |
(...skipping 13 matching lines...) Expand all Loading... |
1268 if (previous && !stack.callFrames.length) | 1268 if (previous && !stack.callFrames.length) |
1269 previous.parent = stack.parent; | 1269 previous.parent = stack.parent; |
1270 else | 1270 else |
1271 previous = stack; | 1271 previous = stack; |
1272 stack = stack.parent; | 1272 stack = stack.parent; |
1273 } | 1273 } |
1274 return asyncStackTrace; | 1274 return asyncStackTrace; |
1275 }, | 1275 }, |
1276 | 1276 |
1277 __proto__: WebInspector.SDKObject.prototype | 1277 __proto__: WebInspector.SDKObject.prototype |
1278 } | 1278 }; |
1279 | 1279 |
1280 /** | 1280 /** |
1281 * @return {!Array<!WebInspector.DebuggerModel>} | 1281 * @return {!Array<!WebInspector.DebuggerModel>} |
1282 */ | 1282 */ |
1283 WebInspector.DebuggerModel.instances = function() | 1283 WebInspector.DebuggerModel.instances = function() |
1284 { | 1284 { |
1285 var result = []; | 1285 var result = []; |
1286 for (var target of WebInspector.targetManager.targets()) { | 1286 for (var target of WebInspector.targetManager.targets()) { |
1287 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); | 1287 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); |
1288 if (debuggerModel) | 1288 if (debuggerModel) |
1289 result.push(debuggerModel); | 1289 result.push(debuggerModel); |
1290 } | 1290 } |
1291 return result; | 1291 return result; |
1292 } | 1292 }; |
1293 | 1293 |
1294 /** | 1294 /** |
1295 * @param {?WebInspector.Target} target | 1295 * @param {?WebInspector.Target} target |
1296 * @return {?WebInspector.DebuggerModel} | 1296 * @return {?WebInspector.DebuggerModel} |
1297 */ | 1297 */ |
1298 WebInspector.DebuggerModel.fromTarget = function(target) | 1298 WebInspector.DebuggerModel.fromTarget = function(target) |
1299 { | 1299 { |
1300 if (!target || !target.hasJSCapability()) | 1300 if (!target || !target.hasJSCapability()) |
1301 return null; | 1301 return null; |
1302 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); | 1302 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); |
1303 } | 1303 }; |
OLD | NEW |