Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/Script.js

Issue 2264013004: [DevTools] Add error check before _reportDeprecatedCommentIfNeeded call (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698