| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 * @param {number} startColumn | 460 * @param {number} startColumn |
| 461 * @param {number} endLine | 461 * @param {number} endLine |
| 462 * @param {number} endColumn | 462 * @param {number} endColumn |
| 463 * @param {!RuntimeAgent.ExecutionContextId} executionContextId | 463 * @param {!RuntimeAgent.ExecutionContextId} executionContextId |
| 464 * @param {string} hash | 464 * @param {string} hash |
| 465 * @param {*|undefined} executionContextAuxData | 465 * @param {*|undefined} executionContextAuxData |
| 466 * @param {boolean} isInternalScript | 466 * @param {boolean} isInternalScript |
| 467 * @param {boolean} isLiveEdit | 467 * @param {boolean} isLiveEdit |
| 468 * @param {string=} sourceMapURL | 468 * @param {string=} sourceMapURL |
| 469 * @param {boolean=} hasSourceURL | 469 * @param {boolean=} hasSourceURL |
| 470 * @param {boolean=} deprecatedCommentWasUsed | |
| 471 * @param {boolean=} hasSyntaxError | 470 * @param {boolean=} hasSyntaxError |
| 472 * @return {!WebInspector.Script} | 471 * @return {!WebInspector.Script} |
| 473 */ | 472 */ |
| 474 _parsedScriptSource: function(scriptId, sourceURL, startLine, startColumn, e
ndLine, endColumn, executionContextId, hash, executionContextAuxData, isInternal
Script, isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed, hasSyn
taxError) | 473 _parsedScriptSource: function(scriptId, sourceURL, startLine, startColumn, e
ndLine, endColumn, executionContextId, hash, executionContextAuxData, isInternal
Script, isLiveEdit, sourceMapURL, hasSourceURL, hasSyntaxError) |
| 475 { | 474 { |
| 476 var isContentScript = false; | 475 var isContentScript = false; |
| 477 if (executionContextAuxData && ("isDefault" in executionContextAuxData)) | 476 if (executionContextAuxData && ("isDefault" in executionContextAuxData)) |
| 478 isContentScript = !executionContextAuxData["isDefault"]; | 477 isContentScript = !executionContextAuxData["isDefault"]; |
| 479 var script = new WebInspector.Script(this, scriptId, sourceURL, startLin
e, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, i
sInternalScript, isLiveEdit, sourceMapURL, hasSourceURL); | 478 var script = new WebInspector.Script(this, scriptId, sourceURL, startLin
e, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, i
sInternalScript, isLiveEdit, sourceMapURL, hasSourceURL); |
| 480 this._registerScript(script); | 479 this._registerScript(script); |
| 481 if (!hasSyntaxError) | 480 if (!hasSyntaxError) |
| 482 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Pars
edScriptSource, script); | 481 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Pars
edScriptSource, script); |
| 483 else | 482 else |
| 484 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Fail
edToParseScriptSource, script); | 483 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Fail
edToParseScriptSource, script); |
| 485 | |
| 486 if (deprecatedCommentWasUsed) { | |
| 487 var text = WebInspector.UIString("'//@ sourceURL' and '//@ sourceMap
pingURL' are deprecated, please use '//# sourceURL=' and '//# sourceMappingURL='
instead."); | |
| 488 var msg = new WebInspector.ConsoleMessage(this.target(), WebInspecto
r.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageLevel.Warn
ing, text, undefined, undefined, undefined, undefined, undefined, undefined, und
efined, undefined, undefined, scriptId); | |
| 489 var consoleModel = this.target().consoleModel; | |
| 490 if (consoleModel) | |
| 491 consoleModel.addMessage(msg); | |
| 492 } | |
| 493 return script; | 484 return script; |
| 494 }, | 485 }, |
| 495 | 486 |
| 496 /** | 487 /** |
| 497 * @param {!WebInspector.Script} script | 488 * @param {!WebInspector.Script} script |
| 498 */ | 489 */ |
| 499 _registerScript: function(script) | 490 _registerScript: function(script) |
| 500 { | 491 { |
| 501 this._scripts[script.scriptId] = script; | 492 this._scripts[script.scriptId] = script; |
| 502 if (script.isAnonymousScript()) | 493 if (script.isAnonymousScript()) |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 * @param {number} startColumn | 841 * @param {number} startColumn |
| 851 * @param {number} endLine | 842 * @param {number} endLine |
| 852 * @param {number} endColumn | 843 * @param {number} endColumn |
| 853 * @param {!RuntimeAgent.ExecutionContextId} executionContextId | 844 * @param {!RuntimeAgent.ExecutionContextId} executionContextId |
| 854 * @param {string} hash | 845 * @param {string} hash |
| 855 * @param {*=} executionContextAuxData | 846 * @param {*=} executionContextAuxData |
| 856 * @param {boolean=} isInternalScript | 847 * @param {boolean=} isInternalScript |
| 857 * @param {boolean=} isLiveEdit | 848 * @param {boolean=} isLiveEdit |
| 858 * @param {string=} sourceMapURL | 849 * @param {string=} sourceMapURL |
| 859 * @param {boolean=} hasSourceURL | 850 * @param {boolean=} hasSourceURL |
| 860 * @param {boolean=} deprecatedCommentWasUsed | |
| 861 */ | 851 */ |
| 862 scriptParsed: function(scriptId, sourceURL, startLine, startColumn, endLine,
endColumn, executionContextId, hash, executionContextAuxData, isInternalScript,
isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) | 852 scriptParsed: function(scriptId, sourceURL, startLine, startColumn, endLine,
endColumn, executionContextId, hash, executionContextAuxData, isInternalScript,
isLiveEdit, sourceMapURL, hasSourceURL) |
| 863 { | 853 { |
| 864 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine,
startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxDa
ta, !!isInternalScript, !!isLiveEdit, sourceMapURL, hasSourceURL, deprecatedComm
entWasUsed, false); | 854 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine,
startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxDa
ta, !!isInternalScript, !!isLiveEdit, sourceMapURL, hasSourceURL, false); |
| 865 }, | 855 }, |
| 866 | 856 |
| 867 /** | 857 /** |
| 868 * @override | 858 * @override |
| 869 * @param {!RuntimeAgent.ScriptId} scriptId | 859 * @param {!RuntimeAgent.ScriptId} scriptId |
| 870 * @param {string} sourceURL | 860 * @param {string} sourceURL |
| 871 * @param {number} startLine | 861 * @param {number} startLine |
| 872 * @param {number} startColumn | 862 * @param {number} startColumn |
| 873 * @param {number} endLine | 863 * @param {number} endLine |
| 874 * @param {number} endColumn | 864 * @param {number} endColumn |
| 875 * @param {!RuntimeAgent.ExecutionContextId} executionContextId | 865 * @param {!RuntimeAgent.ExecutionContextId} executionContextId |
| 876 * @param {string} hash | 866 * @param {string} hash |
| 877 * @param {*=} executionContextAuxData | 867 * @param {*=} executionContextAuxData |
| 878 * @param {boolean=} isInternalScript | 868 * @param {boolean=} isInternalScript |
| 879 * @param {string=} sourceMapURL | 869 * @param {string=} sourceMapURL |
| 880 * @param {boolean=} hasSourceURL | 870 * @param {boolean=} hasSourceURL |
| 881 * @param {boolean=} deprecatedCommentWasUsed | |
| 882 */ | 871 */ |
| 883 scriptFailedToParse: function(scriptId, sourceURL, startLine, startColumn, e
ndLine, endColumn, executionContextId, hash, executionContextAuxData, isInternal
Script, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) | 872 scriptFailedToParse: function(scriptId, sourceURL, startLine, startColumn, e
ndLine, endColumn, executionContextId, hash, executionContextAuxData, isInternal
Script, sourceMapURL, hasSourceURL) |
| 884 { | 873 { |
| 885 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine,
startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxDa
ta, !!isInternalScript, false, sourceMapURL, hasSourceURL, deprecatedCommentWasU
sed, true); | 874 this._debuggerModel._parsedScriptSource(scriptId, sourceURL, startLine,
startColumn, endLine, endColumn, executionContextId, hash, executionContextAuxDa
ta, !!isInternalScript, false, sourceMapURL, hasSourceURL, true); |
| 886 }, | 875 }, |
| 887 | 876 |
| 888 /** | 877 /** |
| 889 * @override | 878 * @override |
| 890 * @param {!DebuggerAgent.BreakpointId} breakpointId | 879 * @param {!DebuggerAgent.BreakpointId} breakpointId |
| 891 * @param {!DebuggerAgent.Location} location | 880 * @param {!DebuggerAgent.Location} location |
| 892 */ | 881 */ |
| 893 breakpointResolved: function(breakpointId, location) | 882 breakpointResolved: function(breakpointId, location) |
| 894 { | 883 { |
| 895 this._debuggerModel._breakpointResolved(breakpointId, location); | 884 this._debuggerModel._breakpointResolved(breakpointId, location); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 /** | 1277 /** |
| 1289 * @param {?WebInspector.Target} target | 1278 * @param {?WebInspector.Target} target |
| 1290 * @return {?WebInspector.DebuggerModel} | 1279 * @return {?WebInspector.DebuggerModel} |
| 1291 */ | 1280 */ |
| 1292 WebInspector.DebuggerModel.fromTarget = function(target) | 1281 WebInspector.DebuggerModel.fromTarget = function(target) |
| 1293 { | 1282 { |
| 1294 if (!target || !target.hasJSCapability()) | 1283 if (!target || !target.hasJSCapability()) |
| 1295 return null; | 1284 return null; |
| 1296 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); | 1285 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); |
| 1297 } | 1286 } |
| OLD | NEW |