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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber) | 76 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber) |
77 columnNumber -= script.columnOffset; | 77 columnNumber -= script.columnOffset; |
78 return uiSourceCode.uiLocation(lineNumber, columnNumber); | 78 return uiSourceCode.uiLocation(lineNumber, columnNumber); |
79 } | 79 } |
80 | 80 |
81 /** | 81 /** |
82 * @override | 82 * @override |
83 * @param {!Workspace.UISourceCode} uiSourceCode | 83 * @param {!Workspace.UISourceCode} uiSourceCode |
84 * @param {number} lineNumber | 84 * @param {number} lineNumber |
85 * @param {number} columnNumber | 85 * @param {number} columnNumber |
86 * @return {!Array<!SDK.DebuggerModel.Location>} | 86 * @return {?SDK.DebuggerModel.Location} |
87 */ | 87 */ |
88 uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) { | 88 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { |
89 var scripts = this._scriptsForUISourceCode(uiSourceCode); | 89 var scripts = this._scriptsForUISourceCode(uiSourceCode); |
90 console.assert(scripts.length); | 90 console.assert(scripts.length); |
91 var script = scripts[scripts.length - 1]; | 91 var script = scripts[scripts.length - 1]; |
92 var location; | |
93 if (script.isInlineScriptWithSourceURL()) { | 92 if (script.isInlineScriptWithSourceURL()) { |
94 location = this._debuggerModel.createRawLocation( | 93 return this._debuggerModel.createRawLocation( |
95 script, lineNumber + script.lineOffset, lineNumber ? columnNumber : co
lumnNumber + script.columnOffset); | 94 script, lineNumber + script.lineOffset, lineNumber ? columnNumber : co
lumnNumber + script.columnOffset); |
96 } else { | |
97 location = this._debuggerModel.createRawLocation(script, lineNumber, colum
nNumber); | |
98 } | 95 } |
99 return location ? [location] : []; | 96 return this._debuggerModel.createRawLocation(script, lineNumber, columnNumbe
r); |
100 } | 97 } |
101 | 98 |
102 /** | 99 /** |
103 * @param {!SDK.Script} script | 100 * @param {!SDK.Script} script |
104 */ | 101 */ |
105 addScript(script) { | 102 addScript(script) { |
106 if (script.isAnonymousScript()) | 103 if (script.isAnonymousScript()) |
107 return; | 104 return; |
108 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); | 105 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); |
109 | 106 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 hasSourceMapURL() { | 434 hasSourceMapURL() { |
438 return this._script && !!this._script.sourceMapURL; | 435 return this._script && !!this._script.sourceMapURL; |
439 } | 436 } |
440 }; | 437 }; |
441 | 438 |
442 /** @enum {symbol} */ | 439 /** @enum {symbol} */ |
443 Bindings.ResourceScriptFile.Events = { | 440 Bindings.ResourceScriptFile.Events = { |
444 DidMergeToVM: Symbol('DidMergeToVM'), | 441 DidMergeToVM: Symbol('DidMergeToVM'), |
445 DidDivergeFromVM: Symbol('DidDivergeFromVM'), | 442 DidDivergeFromVM: Symbol('DidDivergeFromVM'), |
446 }; | 443 }; |
OLD | NEW |