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);
|
return callback("Could not load language handler " + modulePath + ": " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var handler;
|
|
||||||
try {
|
require([modulePath], function(handler) {
|
||||||
handler = require(modulePath);
|
|
||||||
if (!handler)
|
if (!handler)
|
||||||
throw new Error("Unable to load required module: " + modulePath);
|
return callback("Could not load language handler " + modulePath);
|
||||||
} catch (e) {
|
callback(null, handler);
|
||||||
if (isInWebWorker)
|
}, function(err) {
|
||||||
return callback("Could not load language handler " + modulePath + ": " + e);
|
callback(err);
|
||||||
|
});
|
||||||
// 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);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
worker.handlesLanguage = function(language, part) {
|
worker.handlesLanguage = function(language, part) {
|
||||||
|
|
|
@ -213,7 +213,7 @@ var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
|
||||||
|
|
||||||
var processNext = function() {
|
var processNext = function() {
|
||||||
var msg = _self.messageBuffer.shift();
|
var msg = _self.messageBuffer.shift();
|
||||||
if (msg.command)
|
if (msg.command && main[msg.command])
|
||||||
main[msg.command].apply(main, msg.args);
|
main[msg.command].apply(main, msg.args);
|
||||||
else if (msg.event)
|
else if (msg.event)
|
||||||
sender._signal(msg.event, msg.data);
|
sender._signal(msg.event, msg.data);
|
||||||
|
|
Ładowanie…
Reference in New Issue