OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber) | 77 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber) |
78 columnNumber -= script.columnOffset; | 78 columnNumber -= script.columnOffset; |
79 return uiSourceCode.uiLocation(lineNumber, columnNumber); | 79 return uiSourceCode.uiLocation(lineNumber, columnNumber); |
80 } | 80 } |
81 | 81 |
82 /** | 82 /** |
83 * @override | 83 * @override |
84 * @param {!Workspace.UISourceCode} uiSourceCode | 84 * @param {!Workspace.UISourceCode} uiSourceCode |
85 * @param {number} lineNumber | 85 * @param {number} lineNumber |
86 * @param {number} columnNumber | 86 * @param {number} columnNumber |
87 * @return {?SDK.DebuggerModel.Location} | 87 * @return {!Array<!SDK.DebuggerModel.Location>} |
88 */ | 88 */ |
89 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { | 89 uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) { |
90 var script = uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol]; | 90 var script = uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol]; |
| 91 var location; |
91 if (script.isInlineScriptWithSourceURL()) { | 92 if (script.isInlineScriptWithSourceURL()) { |
92 return this._debuggerModel.createRawLocation( | 93 location = this._debuggerModel.createRawLocation( |
93 script, lineNumber + script.lineOffset, lineNumber ? columnNumber : co
lumnNumber + script.columnOffset); | 94 script, lineNumber + script.lineOffset, lineNumber ? columnNumber : co
lumnNumber + script.columnOffset); |
| 95 } else { |
| 96 location = this._debuggerModel.createRawLocation(script, lineNumber, colum
nNumber); |
94 } | 97 } |
95 return this._debuggerModel.createRawLocation(script, lineNumber, columnNumbe
r); | 98 return location ? [location] : []; |
96 } | 99 } |
97 | 100 |
98 /** | 101 /** |
99 * @param {!SDK.Script} script | 102 * @param {!SDK.Script} script |
100 */ | 103 */ |
101 addScript(script) { | 104 addScript(script) { |
102 var name = Common.ParsedURL.extractName(script.sourceURL); | 105 var name = Common.ParsedURL.extractName(script.sourceURL); |
103 var url = 'debugger:///VM' + script.scriptId + (name ? ' ' + name : ''); | 106 var url = 'debugger:///VM' + script.scriptId + (name ? ' ' + name : ''); |
104 | 107 |
105 var uiSourceCode = this._project.createUISourceCode(url, Common.resourceType
s.Script); | 108 var uiSourceCode = this._project.createUISourceCode(url, Common.resourceType
s.Script); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 150 |
148 dispose() { | 151 dispose() { |
149 Common.EventTarget.removeEventListeners(this._eventListeners); | 152 Common.EventTarget.removeEventListeners(this._eventListeners); |
150 this._debuggerReset(); | 153 this._debuggerReset(); |
151 this._project.dispose(); | 154 this._project.dispose(); |
152 } | 155 } |
153 }; | 156 }; |
154 | 157 |
155 Bindings.DefaultScriptMapping._scriptSymbol = Symbol('symbol'); | 158 Bindings.DefaultScriptMapping._scriptSymbol = Symbol('symbol'); |
156 Bindings.DefaultScriptMapping._uiSourceCodeSymbol = Symbol('uiSourceCodeSymbol')
; | 159 Bindings.DefaultScriptMapping._uiSourceCodeSymbol = Symbol('uiSourceCodeSymbol')
; |
OLD | NEW |