do not throw if require.toUrl is missing
This commit is contained in:
parent
60c882738c
commit
9a170dcd03
1 changed files with 6 additions and 5 deletions
|
|
@ -41,14 +41,15 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
|
|||
this.onMessage = this.onMessage.bind(this);
|
||||
this.onError = this.onError.bind(this);
|
||||
|
||||
// nameToUrl is renamed to toUrl in requirejs 2
|
||||
if (require.nameToUrl && !require.toUrl)
|
||||
require.toUrl = require.nameToUrl;
|
||||
|
||||
var workerUrl;
|
||||
if (config.get("packaged")) {
|
||||
if (config.get("packaged") || !require.toUrl) {
|
||||
workerUrl = config.moduleUrl(mod, "worker");
|
||||
} else {
|
||||
var normalizePath = this.$normalizePath;
|
||||
// nameToUrl is renamed to toUrl in requirejs 2
|
||||
if (require.nameToUrl && !require.toUrl)
|
||||
require.toUrl = require.nameToUrl;
|
||||
workerUrl = normalizePath(require.toUrl("ace/worker/worker.js", null, "_"));
|
||||
|
||||
var tlns = {};
|
||||
|
|
@ -184,7 +185,7 @@ var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
|
|||
var sender = Object.create(EventEmitter);
|
||||
var _self = this;
|
||||
|
||||
this.$worker = {}
|
||||
this.$worker = {};
|
||||
this.$worker.terminate = function() {};
|
||||
this.$worker.postMessage = function(e) {
|
||||
_self.messageBuffer.push(e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue