OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 /** | 4 /** |
5 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 Sources.JavaScriptCompiler = class { | 7 Sources.JavaScriptCompiler = class { |
8 /** | 8 /** |
9 * @param {!Sources.JavaScriptSourceFrame} sourceFrame | 9 * @param {!Sources.JavaScriptSourceFrame} sourceFrame |
10 */ | 10 */ |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 /** | 26 /** |
27 * @return {?SDK.RuntimeModel} | 27 * @return {?SDK.RuntimeModel} |
28 */ | 28 */ |
29 _findRuntimeModel() { | 29 _findRuntimeModel() { |
30 var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); | 30 var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); |
31 var sourceCode = this._sourceFrame.uiSourceCode(); | 31 var sourceCode = this._sourceFrame.uiSourceCode(); |
32 for (var i = 0; i < debuggerModels.length; ++i) { | 32 for (var i = 0; i < debuggerModels.length; ++i) { |
33 var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(sourceCode,
debuggerModels[i]); | 33 var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(sourceCode,
debuggerModels[i]); |
34 if (scriptFile) | 34 if (scriptFile) |
35 return debuggerModels[i].target().runtimeModel; | 35 return debuggerModels[i].runtimeModel(); |
36 } | 36 } |
37 return SDK.targetManager.mainTarget() ? SDK.targetManager.mainTarget().runti
meModel : null; | 37 return SDK.targetManager.mainTarget() ? SDK.targetManager.mainTarget().runti
meModel : null; |
38 } | 38 } |
39 | 39 |
40 _compile() { | 40 _compile() { |
41 var runtimeModel = this._findRuntimeModel(); | 41 var runtimeModel = this._findRuntimeModel(); |
42 if (!runtimeModel) | 42 if (!runtimeModel) |
43 return; | 43 return; |
44 var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); | 44 var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); |
45 if (!currentExecutionContext) | 45 if (!currentExecutionContext) |
(...skipping 22 matching lines...) Expand all Loading... |
68 Workspace.UISourceCode.Message.Level.Error, text, exceptionDetails.lin
eNumber, exceptionDetails.columnNumber); | 68 Workspace.UISourceCode.Message.Level.Error, text, exceptionDetails.lin
eNumber, exceptionDetails.columnNumber); |
69 this._compilationFinishedForTest(); | 69 this._compilationFinishedForTest(); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 _compilationFinishedForTest() { | 73 _compilationFinishedForTest() { |
74 } | 74 } |
75 }; | 75 }; |
76 | 76 |
77 Sources.JavaScriptCompiler.CompileDelay = 1000; | 77 Sources.JavaScriptCompiler.CompileDelay = 1000; |
OLD | NEW |