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

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: addressed comments Created 4 years, 3 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) ;
186 } else {
187 this._source = "";
188 }
185 callback(this._source); 189 callback(this._source);
186 } 190 }
187 }, 191 },
188 192
189 /** 193 /**
190 * @override 194 * @override
191 * @param {string} query 195 * @param {string} query
192 * @param {boolean} caseSensitive 196 * @param {boolean} caseSensitive
193 * @param {boolean} isRegex 197 * @param {boolean} isRegex
194 * @param {function(!Array.<!DebuggerAgent.SearchMatch>)} callback 198 * @param {function(!Array.<!DebuggerAgent.SearchMatch>)} callback
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 { 338 {
335 if (error) 339 if (error)
336 console.error(error); 340 console.error(error);
337 fulfill(!error); 341 fulfill(!error);
338 } 342 }
339 } 343 }
340 }, 344 },
341 345
342 __proto__: WebInspector.SDKObject.prototype 346 __proto__: WebInspector.SDKObject.prototype
343 } 347 }
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