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

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

Issue 373743003: DevTools: Add support for adding source map to a script from the DevTools window. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 5 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 | Annotate | Revision Log
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 this.sourceMapURL = sourceMapURL; 51 this.sourceMapURL = sourceMapURL;
52 this.hasSourceURL = hasSourceURL; 52 this.hasSourceURL = hasSourceURL;
53 /** @type {!Set.<!WebInspector.Script.Location>} */ 53 /** @type {!Set.<!WebInspector.Script.Location>} */
54 this._locations = new Set(); 54 this._locations = new Set();
55 /** @type {!Array.<!WebInspector.SourceMapping>} */ 55 /** @type {!Array.<!WebInspector.SourceMapping>} */
56 this._sourceMappings = []; 56 this._sourceMappings = [];
57 } 57 }
58 58
59 WebInspector.Script.Events = { 59 WebInspector.Script.Events = {
60 ScriptEdited: "ScriptEdited", 60 ScriptEdited: "ScriptEdited",
61 SourceMapURLAdded: "SourceMapURLAdded",
61 } 62 }
62 63
63 WebInspector.Script.snippetSourceURLPrefix = "snippets:///"; 64 WebInspector.Script.snippetSourceURLPrefix = "snippets:///";
64 65
65 WebInspector.Script.sourceURLRegex = /\n[\040\t]*\/\/[@#]\ssourceURL=\s*(\S*?)\s *$/mg; 66 WebInspector.Script.sourceURLRegex = /\n[\040\t]*\/\/[@#]\ssourceURL=\s*(\S*?)\s *$/mg;
66 67
67 /** 68 /**
68 * @param {string} source 69 * @param {string} source
69 * @return {string} 70 * @return {string}
70 */ 71 */
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 /** 207 /**
207 * @return {boolean} 208 * @return {boolean}
208 */ 209 */
209 isInlineScript: function() 210 isInlineScript: function()
210 { 211 {
211 var startsAtZero = !this.lineOffset && !this.columnOffset; 212 var startsAtZero = !this.lineOffset && !this.columnOffset;
212 return !!this.sourceURL && !startsAtZero; 213 return !!this.sourceURL && !startsAtZero;
213 }, 214 },
214 215
215 /** 216 /**
217 * @param {string} sourceMapURL
218 */
219 addSourceMapURL: function(sourceMapURL)
220 {
221 if (this.sourceMapURL)
222 return;
223 this.sourceMapURL = sourceMapURL;
224 this.dispatchEventToListeners(WebInspector.Script.Events.SourceMapURLAdd ed, this.sourceMapURL);
225 },
226
227 /**
216 * @return {boolean} 228 * @return {boolean}
217 */ 229 */
218 isAnonymousScript: function() 230 isAnonymousScript: function()
219 { 231 {
220 return !this.sourceURL; 232 return !this.sourceURL;
221 }, 233 },
222 234
223 /** 235 /**
224 * @return {boolean} 236 * @return {boolean}
225 */ 237 */
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 }, 333 },
322 334
323 dispose: function() 335 dispose: function()
324 { 336 {
325 WebInspector.LiveLocation.prototype.dispose.call(this); 337 WebInspector.LiveLocation.prototype.dispose.call(this);
326 this._script._locations.remove(this); 338 this._script._locations.remove(this);
327 }, 339 },
328 340
329 __proto__: WebInspector.LiveLocation.prototype 341 __proto__: WebInspector.LiveLocation.prototype
330 } 342 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/ResourceScriptMapping.js ('k') | Source/devtools/front_end/sdk/UISourceCode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698