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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 uiSourceCode.setWorkingCopy(sassText); | 95 uiSourceCode.setWorkingCopy(sassText); |
96 } | 96 } |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 /** | 100 /** |
101 * @param {!SDK.CSSLocation} rawLocation | 101 * @param {!SDK.CSSLocation} rawLocation |
102 * @return {?Workspace.UILocation} | 102 * @return {?Workspace.UILocation} |
103 */ | 103 */ |
104 rawLocationToUILocation(rawLocation) { | 104 rawLocationToUILocation(rawLocation) { |
105 var sourceMap = this._cssModel.sourceMapForHeader(rawLocation.header()); | 105 var header = rawLocation.header(); |
| 106 if (!header) |
| 107 return null; |
| 108 var sourceMap = this._cssModel.sourceMapForHeader(header); |
106 if (!sourceMap) | 109 if (!sourceMap) |
107 return null; | 110 return null; |
108 var entry = sourceMap.findEntry(rawLocation.lineNumber, rawLocation.columnNu
mber); | 111 var entry = sourceMap.findEntry(rawLocation.lineNumber, rawLocation.columnNu
mber); |
109 if (!entry || !entry.sourceURL) | 112 if (!entry || !entry.sourceURL) |
110 return null; | 113 return null; |
111 var uiSourceCode = | 114 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForStyleURL(this._wor
kspace, entry.sourceURL, header); |
112 Bindings.NetworkProject.uiSourceCodeForStyleURL(this._workspace, entry.s
ourceURL, rawLocation.header()); | |
113 if (!uiSourceCode) | 115 if (!uiSourceCode) |
114 return null; | 116 return null; |
115 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); | 117 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); |
116 } | 118 } |
117 | 119 |
118 dispose() { | 120 dispose() { |
119 Common.EventTarget.removeEventListeners(this._eventListeners); | 121 Common.EventTarget.removeEventListeners(this._eventListeners); |
120 } | 122 } |
121 }; | 123 }; |
OLD | NEW |