nameToUrl is renamed to toUrl in requirejs 2
This commit is contained in:
parent
01c4cb8ea8
commit
a230c15950
1 changed files with 5 additions and 2 deletions
|
|
@ -56,14 +56,17 @@ var WorkerClient = function(topLevelNamespaces, packagedJs, mod, classname) {
|
||||||
workerUrl = require.nameToUrl("ace/worker/worker_sourcemint");
|
workerUrl = require.nameToUrl("ace/worker/worker_sourcemint");
|
||||||
} else {
|
} else {
|
||||||
// We are running in RequireJS.
|
// We are running in RequireJS.
|
||||||
workerUrl = this.$normalizePath(require.nameToUrl("ace/worker/worker", null, "_"));
|
// nameToUrl is renamed to toUrl in requirejs 2
|
||||||
|
if (require.nameToUrl && !require.toUrl)
|
||||||
|
require.toUrl = require.nameToUrl;
|
||||||
|
workerUrl = this.$normalizePath(require.toUrl("ace/worker/worker", null, "_"));
|
||||||
}
|
}
|
||||||
this.$worker = new Worker(workerUrl);
|
this.$worker = new Worker(workerUrl);
|
||||||
|
|
||||||
var tlns = {};
|
var tlns = {};
|
||||||
for (var i=0; i<topLevelNamespaces.length; i++) {
|
for (var i=0; i<topLevelNamespaces.length; i++) {
|
||||||
var ns = topLevelNamespaces[i];
|
var ns = topLevelNamespaces[i];
|
||||||
var path = this.$normalizePath(require.nameToUrl(ns, null, "_").replace(/.js$/, ""));
|
var path = this.$normalizePath(require.toUrl(ns, null, "_").replace(/.js$/, ""));
|
||||||
|
|
||||||
tlns[ns] = path;
|
tlns[ns] = path;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue