Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 this.target().debuggerAgent().getScriptSource(this.scriptId, didGetScrip tSource.bind(this)); | 173 this.target().debuggerAgent().getScriptSource(this.scriptId, didGetScrip tSource.bind(this)); |
| 174 return promise; | 174 return promise; |
| 175 | 175 |
| 176 /** | 176 /** |
| 177 * @this {WebInspector.Script} | 177 * @this {WebInspector.Script} |
| 178 * @param {?Protocol.Error} error | 178 * @param {?Protocol.Error} error |
| 179 * @param {string} source | 179 * @param {string} source |
| 180 */ | 180 */ |
| 181 function didGetScriptSource(error, source) | 181 function didGetScriptSource(error, source) |
| 182 { | 182 { |
| 183 WebInspector.Script._reportDeprecatedCommentIfNeeded(this, source); | 183 if (!error) { |
| 184 this._source = WebInspector.Script._trimSourceURLComment(error ? "" : source); | 184 WebInspector.Script._reportDeprecatedCommentIfNeeded(this, sourc e); |
| 185 this._source = WebInspector.Script._trimSourceURLComment(source) ; | |
|
dgozman
2016/08/22 16:59:05
Let's assign empty source in case of error.
kozy
2016/08/22 17:10:41
Done.
| |
| 186 } | |
| 185 callback(this._source); | 187 callback(this._source); |
| 186 } | 188 } |
| 187 }, | 189 }, |
| 188 | 190 |
| 189 /** | 191 /** |
| 190 * @override | 192 * @override |
| 191 * @param {string} query | 193 * @param {string} query |
| 192 * @param {boolean} caseSensitive | 194 * @param {boolean} caseSensitive |
| 193 * @param {boolean} isRegex | 195 * @param {boolean} isRegex |
| 194 * @param {function(!Array.<!DebuggerAgent.SearchMatch>)} callback | 196 * @param {function(!Array.<!DebuggerAgent.SearchMatch>)} callback |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 { | 336 { |
| 335 if (error) | 337 if (error) |
| 336 console.error(error); | 338 console.error(error); |
| 337 fulfill(!error); | 339 fulfill(!error); |
| 338 } | 340 } |
| 339 } | 341 } |
| 340 }, | 342 }, |
| 341 | 343 |
| 342 __proto__: WebInspector.SDKObject.prototype | 344 __proto__: WebInspector.SDKObject.prototype |
| 343 } | 345 } |
| OLD | NEW |