|
|
|
@ -10,7 +10,7 @@ var EventManager = require('../lib/eventManager'); |
|
|
|
|
/* |
|
|
|
|
trigger compilationFinished, compilerLoaded, compilationStarted |
|
|
|
|
*/ |
|
|
|
|
function Compiler (editor, queryParams, handleGithubCall, updateFiles) { |
|
|
|
|
function Compiler (editor, handleGithubCall) { |
|
|
|
|
var self = this; |
|
|
|
|
this.event = new EventManager(); |
|
|
|
|
|
|
|
|
@ -20,6 +20,12 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) { |
|
|
|
|
var cachedRemoteFiles = {}; |
|
|
|
|
var worker = null; |
|
|
|
|
|
|
|
|
|
var optimize = false; |
|
|
|
|
|
|
|
|
|
this.setOptimize = function (_optimize) { |
|
|
|
|
optimize = _optimize; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var compile = function (missingInputs) { |
|
|
|
|
editor.clearAnnotations(); |
|
|
|
|
self.event.trigger('compilationStarted', []); |
|
|
|
@ -33,7 +39,6 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) { |
|
|
|
|
self.lastCompilationResult = null; |
|
|
|
|
self.event.trigger('compilationFinished', [false, { 'error': error }, files]); |
|
|
|
|
} else { |
|
|
|
|
var optimize = queryParams.get().optimize; |
|
|
|
|
compileJSON(input, optimize ? 1 : 0); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|