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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js

Issue 2198443004: [DevTools] Fix location.script().sourceURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a 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
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 WebInspector.ResourceScriptMapping.prototype = { 57 WebInspector.ResourceScriptMapping.prototype = {
58 /** 58 /**
59 * @override 59 * @override
60 * @param {!WebInspector.DebuggerModel.Location} rawLocation 60 * @param {!WebInspector.DebuggerModel.Location} rawLocation
61 * @return {?WebInspector.UILocation} 61 * @return {?WebInspector.UILocation}
62 */ 62 */
63 rawLocationToUILocation: function(rawLocation) 63 rawLocationToUILocation: function(rawLocation)
64 { 64 {
65 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat ion} */ (rawLocation); 65 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat ion} */ (rawLocation);
66 var script = debuggerModelLocation.script(); 66 var script = debuggerModelLocation.script();
67 if (!script)
68 return null;
67 var uiSourceCode = this._workspaceUISourceCodeForScript(script); 69 var uiSourceCode = this._workspaceUISourceCodeForScript(script);
68 if (!uiSourceCode) 70 if (!uiSourceCode)
69 return null; 71 return null;
70 var scriptFile = this.scriptFile(uiSourceCode); 72 var scriptFile = this.scriptFile(uiSourceCode);
71 if (scriptFile && ((scriptFile.hasDivergedFromVM() && !scriptFile.isMerg ingToVM()) || scriptFile.isDivergingFromVM())) 73 if (scriptFile && ((scriptFile.hasDivergedFromVM() && !scriptFile.isMerg ingToVM()) || scriptFile.isDivergingFromVM()))
72 return null; 74 return null;
73 var lineNumber = debuggerModelLocation.lineNumber - (script.isInlineScri ptWithSourceURL() ? script.lineOffset : 0); 75 var lineNumber = debuggerModelLocation.lineNumber - (script.isInlineScri ptWithSourceURL() ? script.lineOffset : 0);
74 var columnNumber = debuggerModelLocation.columnNumber || 0; 76 var columnNumber = debuggerModelLocation.columnNumber || 0;
75 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber) 77 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber)
76 columnNumber -= script.columnOffset; 78 columnNumber -= script.columnOffset;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 /** 481 /**
480 * @return {boolean} 482 * @return {boolean}
481 */ 483 */
482 hasSourceMapURL: function() 484 hasSourceMapURL: function()
483 { 485 {
484 return this._script && !!this._script.sourceMapURL; 486 return this._script && !!this._script.sourceMapURL;
485 }, 487 },
486 488
487 __proto__: WebInspector.Object.prototype 489 __proto__: WebInspector.Object.prototype
488 } 490 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698