kopia lustrzana https://github.com/c9/core
fix ?noworker=1 mode
rodzic
bcebf55505
commit
904c80f4e9
|
@ -118,23 +118,14 @@ worker.loadPlugin = function(modulePath, contents, callback) {
|
|||
return callback("Could not load language handler " + modulePath + ": " + e);
|
||||
}
|
||||
}
|
||||
var handler;
|
||||
try {
|
||||
handler = require(modulePath);
|
||||
|
||||
require([modulePath], function(handler) {
|
||||
if (!handler)
|
||||
throw new Error("Unable to load required module: " + modulePath);
|
||||
} catch (e) {
|
||||
if (isInWebWorker)
|
||||
return callback("Could not load language handler " + modulePath + ": " + e);
|
||||
|
||||
// In ?noworker=1 debugging mode, synchronous require doesn't work
|
||||
return require([modulePath], function(handler) {
|
||||
if (!handler)
|
||||
return callback("Could not load language handler " + modulePath);
|
||||
callback(null, handler);
|
||||
});
|
||||
}
|
||||
callback(null, handler);
|
||||
return callback("Could not load language handler " + modulePath);
|
||||
callback(null, handler);
|
||||
}, function(err) {
|
||||
callback(err);
|
||||
});
|
||||
};
|
||||
|
||||
worker.handlesLanguage = function(language, part) {
|
||||
|
|
|
@ -213,7 +213,7 @@ var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
|
|||
|
||||
var processNext = function() {
|
||||
var msg = _self.messageBuffer.shift();
|
||||
if (msg.command)
|
||||
if (msg.command && main[msg.command])
|
||||
main[msg.command].apply(main, msg.args);
|
||||
else if (msg.event)
|
||||
sender._signal(msg.event, msg.data);
|
||||
|
|
Ładowanie…
Reference in New Issue