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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js

Issue 2649593002: DevTools: add missing check for null script in SourceMapNamesResolver (Closed)
Patch Set: Created 3 years, 11 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 Sources.SourceMapNamesResolver = {}; 4 Sources.SourceMapNamesResolver = {};
5 5
6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache'); 6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache');
7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi ers'); 7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi ers');
8 8
9 /** 9 /**
10 * @unrestricted 10 * @unrestricted
(...skipping 13 matching lines...) Expand all
24 24
25 /** 25 /**
26 * @param {!SDK.DebuggerModel.Scope} scope 26 * @param {!SDK.DebuggerModel.Scope} scope
27 * @return {!Promise<!Array<!Sources.SourceMapNamesResolver.Identifier>>} 27 * @return {!Promise<!Array<!Sources.SourceMapNamesResolver.Identifier>>}
28 */ 28 */
29 Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) { 29 Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) {
30 var startLocation = scope.startLocation(); 30 var startLocation = scope.startLocation();
31 var endLocation = scope.endLocation(); 31 var endLocation = scope.endLocation();
32 32
33 if (scope.type() === Protocol.Debugger.ScopeType.Global || !startLocation || ! endLocation || 33 if (scope.type() === Protocol.Debugger.ScopeType.Global || !startLocation || ! endLocation ||
34 !startLocation.script().sourceMapURL || (startLocation.script() !== endLoc ation.script())) 34 !startLocation.script() || !startLocation.script().sourceMapURL ||
35 (startLocation.script() !== endLocation.script()))
35 return Promise.resolve(/** @type {!Array<!Sources.SourceMapNamesResolver.Ide ntifier>}*/ ([])); 36 return Promise.resolve(/** @type {!Array<!Sources.SourceMapNamesResolver.Ide ntifier>}*/ ([]));
36 37
37 var script = startLocation.script(); 38 var script = startLocation.script();
38 return script.requestContent().then(onContent); 39 return script.requestContent().then(onContent);
39 40
40 /** 41 /**
41 * @param {?string} content 42 * @param {?string} content
42 * @return {!Promise<!Array<!Sources.SourceMapNamesResolver.Identifier>>} 43 * @return {!Promise<!Array<!Sources.SourceMapNamesResolver.Identifier>>}
43 */ 44 */
44 function onContent(content) { 45 function onContent(content) {
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 326
326 /** 327 /**
327 * @param {!SDK.DebuggerModel.Scope} scope 328 * @param {!SDK.DebuggerModel.Scope} scope
328 * @return {!SDK.RemoteObject} 329 * @return {!SDK.RemoteObject}
329 */ 330 */
330 Sources.SourceMapNamesResolver.resolveScopeInObject = function(scope) { 331 Sources.SourceMapNamesResolver.resolveScopeInObject = function(scope) {
331 var startLocation = scope.startLocation(); 332 var startLocation = scope.startLocation();
332 var endLocation = scope.endLocation(); 333 var endLocation = scope.endLocation();
333 334
334 if (scope.type() === Protocol.Debugger.ScopeType.Global || !startLocation || ! endLocation || 335 if (scope.type() === Protocol.Debugger.ScopeType.Global || !startLocation || ! endLocation ||
335 !startLocation.script().sourceMapURL || startLocation.script() !== endLoca tion.script()) 336 !startLocation.script() || !startLocation.script().sourceMapURL ||
337 startLocation.script() !== endLocation.script())
336 return scope.object(); 338 return scope.object();
337 339
338 return new Sources.SourceMapNamesResolver.RemoteObject(scope); 340 return new Sources.SourceMapNamesResolver.RemoteObject(scope);
339 }; 341 };
340 342
341 /** 343 /**
342 * @unrestricted 344 * @unrestricted
343 */ 345 */
344 Sources.SourceMapNamesResolver.RemoteObject = class extends SDK.RemoteObject { 346 Sources.SourceMapNamesResolver.RemoteObject = class extends SDK.RemoteObject {
345 /** 347 /**
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 533 }
532 534
533 /** 535 /**
534 * @override 536 * @override
535 * @return {boolean} 537 * @return {boolean}
536 */ 538 */
537 isNode() { 539 isNode() {
538 return this._object.isNode(); 540 return this._object.isNode();
539 } 541 }
540 }; 542 };
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