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 22 matching lines...) Expand all Loading... |
33 */ | 33 */ |
34 SDK.DebuggerModel = class extends SDK.SDKModel { | 34 SDK.DebuggerModel = class extends SDK.SDKModel { |
35 /** | 35 /** |
36 * @param {!SDK.Target} target | 36 * @param {!SDK.Target} target |
37 */ | 37 */ |
38 constructor(target) { | 38 constructor(target) { |
39 super(target); | 39 super(target); |
40 | 40 |
41 target.registerDebuggerDispatcher(new SDK.DebuggerDispatcher(this)); | 41 target.registerDebuggerDispatcher(new SDK.DebuggerDispatcher(this)); |
42 this._agent = target.debuggerAgent(); | 42 this._agent = target.debuggerAgent(); |
43 this._runtimeModel = target.model(SDK.RuntimeModel); | 43 this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.Runt
imeModel)); |
44 | 44 |
45 /** @type {?SDK.DebuggerPausedDetails} */ | 45 /** @type {?SDK.DebuggerPausedDetails} */ |
46 this._debuggerPausedDetails = null; | 46 this._debuggerPausedDetails = null; |
47 /** @type {!Object.<string, !SDK.Script>} */ | 47 /** @type {!Object.<string, !SDK.Script>} */ |
48 this._scripts = {}; | 48 this._scripts = {}; |
49 /** @type {!Map.<string, !Array.<!SDK.Script>>} */ | 49 /** @type {!Map.<string, !Array.<!SDK.Script>>} */ |
50 this._scriptsBySourceURL = new Map(); | 50 this._scriptsBySourceURL = new Map(); |
51 /** @type {!Array.<!SDK.Script>} */ | 51 /** @type {!Array.<!SDK.Script>} */ |
52 this._discardableScripts = []; | 52 this._discardableScripts = []; |
53 | 53 |
54 /** @type {!Common.Object} */ | 54 /** @type {!Common.Object} */ |
55 this._breakpointResolvedEventTarget = new Common.Object(); | 55 this._breakpointResolvedEventTarget = new Common.Object(); |
56 | 56 |
57 this._isPausing = false; | 57 this._isPausing = false; |
58 Common.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._paus
eOnExceptionStateChanged, this); | 58 Common.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._paus
eOnExceptionStateChanged, this); |
59 Common.moduleSetting('pauseOnCaughtException').addChangeListener(this._pause
OnExceptionStateChanged, this); | 59 Common.moduleSetting('pauseOnCaughtException').addChangeListener(this._pause
OnExceptionStateChanged, this); |
60 Common.moduleSetting('enableAsyncStackTraces').addChangeListener(this.asyncS
tackTracesStateChanged, this); | 60 Common.moduleSetting('enableAsyncStackTraces').addChangeListener(this.asyncS
tackTracesStateChanged, this); |
61 | 61 |
62 /** @type {!Map<string, string>} */ | 62 /** @type {!Map<string, string>} */ |
63 this._fileURLToNodeJSPath = new Map(); | 63 this._fileURLToNodeJSPath = new Map(); |
64 this.enableDebugger(); | 64 this.enableDebugger(); |
65 | 65 |
66 /** @type {!Map<string, string>} */ | 66 /** @type {!Map<string, string>} */ |
67 this._stringMap = new Map(); | 67 this._stringMap = new Map(); |
68 } | 68 } |
69 | 69 |
70 /** | 70 /** |
71 * @param {?SDK.Target} target | 71 * @return {!SDK.RuntimeModel} |
72 * @return {?SDK.DebuggerModel} | |
73 */ | 72 */ |
74 static fromTarget(target) { | 73 runtimeModel() { |
75 return target ? target.model(SDK.DebuggerModel) : null; | 74 return this._runtimeModel; |
76 } | 75 } |
77 | 76 |
78 /** | 77 /** |
79 * @return {boolean} | 78 * @return {boolean} |
80 */ | 79 */ |
81 debuggerEnabled() { | 80 debuggerEnabled() { |
82 return !!this._debuggerEnabled; | 81 return !!this._debuggerEnabled; |
83 } | 82 } |
84 | 83 |
85 /** | 84 /** |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 stack.callFrames.shift(); | 1361 stack.callFrames.shift(); |
1363 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) | 1362 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) |
1364 previous.parent = stack.parent; | 1363 previous.parent = stack.parent; |
1365 else | 1364 else |
1366 previous = stack; | 1365 previous = stack; |
1367 stack = stack.parent; | 1366 stack = stack.parent; |
1368 } | 1367 } |
1369 return asyncStackTrace; | 1368 return asyncStackTrace; |
1370 } | 1369 } |
1371 }; | 1370 }; |
OLD | NEW |