OLD | NEW |
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 return null; | 414 return null; |
415 | 415 |
416 return uiSourceCode.uiLocation(debuggerModelLocation.lineNumber, debuggerMod
elLocation.columnNumber || 0); | 416 return uiSourceCode.uiLocation(debuggerModelLocation.lineNumber, debuggerMod
elLocation.columnNumber || 0); |
417 } | 417 } |
418 | 418 |
419 /** | 419 /** |
420 * @override | 420 * @override |
421 * @param {!Workspace.UISourceCode} uiSourceCode | 421 * @param {!Workspace.UISourceCode} uiSourceCode |
422 * @param {number} lineNumber | 422 * @param {number} lineNumber |
423 * @param {number} columnNumber | 423 * @param {number} columnNumber |
424 * @return {!Array<!SDK.DebuggerModel.Location>} | 424 * @return {?SDK.DebuggerModel.Location} |
425 */ | 425 */ |
426 uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) { | 426 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { |
427 var script = this._scriptForUISourceCode.get(uiSourceCode); | 427 var script = this._scriptForUISourceCode.get(uiSourceCode); |
428 var location; | 428 if (!script) |
429 if (script) | 429 return null; |
430 location = this._debuggerModel.createRawLocation(script, lineNumber, colum
nNumber); | 430 |
431 return location ? [location] : []; | 431 return this._debuggerModel.createRawLocation(script, lineNumber, columnNumbe
r); |
432 } | 432 } |
433 | 433 |
434 /** | 434 /** |
435 * @param {!SDK.Script} script | 435 * @param {!SDK.Script} script |
436 * @param {!Workspace.UISourceCode} uiSourceCode | 436 * @param {!Workspace.UISourceCode} uiSourceCode |
437 */ | 437 */ |
438 _addScript(script, uiSourceCode) { | 438 _addScript(script, uiSourceCode) { |
439 console.assert(!this._scriptForUISourceCode.get(uiSourceCode)); | 439 console.assert(!this._scriptForUISourceCode.get(uiSourceCode)); |
440 Bindings.debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSo
urceCode, this); | 440 Bindings.debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSo
urceCode, this); |
441 this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode; | 441 this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 */ | 609 */ |
610 deleteFile(uiSourceCode) { | 610 deleteFile(uiSourceCode) { |
611 this._model.deleteScriptSnippet(uiSourceCode); | 611 this._model.deleteScriptSnippet(uiSourceCode); |
612 } | 612 } |
613 }; | 613 }; |
614 | 614 |
615 /** | 615 /** |
616 * @type {!Snippets.ScriptSnippetModel} | 616 * @type {!Snippets.ScriptSnippetModel} |
617 */ | 617 */ |
618 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac
e); | 618 Snippets.scriptSnippetModel = new Snippets.ScriptSnippetModel(Workspace.workspac
e); |
OLD | NEW |