OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 return; | 796 return; |
797 | 797 |
798 event.consume(true); | 798 event.consume(true); |
799 | 799 |
800 this._prompt.clearAutocomplete(); | 800 this._prompt.clearAutocomplete(); |
801 | 801 |
802 var str = this._prompt.text(); | 802 var str = this._prompt.text(); |
803 if (!str.length) | 803 if (!str.length) |
804 return; | 804 return; |
805 | 805 |
806 var target = WebInspector.targetManager.mainTarget(); | |
807 var currentExecutionContext = WebInspector.context.flavor(WebInspector.E
xecutionContext); | 806 var currentExecutionContext = WebInspector.context.flavor(WebInspector.E
xecutionContext); |
808 if (!this._prompt.isCaretAtEndOfPrompt() || !target || !currentExecution
Context) { | 807 if (!this._prompt.isCaretAtEndOfPrompt() || !currentExecutionContext) { |
809 this._appendCommand(str, true); | 808 this._appendCommand(str, true); |
810 return; | 809 return; |
811 } | 810 } |
812 target.runtimeModel.compileScript(str, "", false, currentExecutionContex
t.id, compileCallback.bind(this)); | 811 currentExecutionContext.target().runtimeModel.compileScript(str, "", fal
se, currentExecutionContext.id, compileCallback.bind(this)); |
813 | 812 |
814 /** | 813 /** |
815 * @param {!RuntimeAgent.ScriptId=} scriptId | 814 * @param {!RuntimeAgent.ScriptId=} scriptId |
816 * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails | 815 * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails |
817 * @this {WebInspector.ConsoleView} | 816 * @this {WebInspector.ConsoleView} |
818 */ | 817 */ |
819 function compileCallback(scriptId, exceptionDetails) | 818 function compileCallback(scriptId, exceptionDetails) |
820 { | 819 { |
821 if (str !== this._prompt.text()) | 820 if (str !== this._prompt.text()) |
822 return; | 821 return; |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 return true; | 1440 return true; |
1442 } | 1441 } |
1443 return false; | 1442 return false; |
1444 } | 1443 } |
1445 } | 1444 } |
1446 | 1445 |
1447 /** | 1446 /** |
1448 * @typedef {{messageIndex: number, matchIndex: number}} | 1447 * @typedef {{messageIndex: number, matchIndex: number}} |
1449 */ | 1448 */ |
1450 WebInspector.ConsoleView.RegexMatchRange; | 1449 WebInspector.ConsoleView.RegexMatchRange; |
OLD | NEW |