diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 1d258db7..73abf1c1 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -417,9 +417,7 @@ var buildAce = function(options) { source: [{ project: workerProject, require: [ - 'ace/lib/fixoldbrowsers', - 'ace/lib/event_emitter', - 'ace/lib/oop', + 'ace/worker/worker', 'ace/mode/' + mode + '_worker' ] }], @@ -428,7 +426,6 @@ var buildAce = function(options) { }); copy({ source: [ - ACE_HOME + "/lib/ace/worker/worker.js", worker ], filter: options.compress ? [copy.filter.uglifyjs] : [], diff --git a/lib/ace/worker/worker.js b/lib/ace/worker/worker.js index 96ab3989..b0f1a5e7 100644 --- a/lib/ace/worker/worker.js +++ b/lib/ace/worker/worker.js @@ -38,6 +38,10 @@ window.normalizeModule = function(parentId, moduleName) { }; window.require = function(parentId, id) { + if (!id) { + id = parentId + parentId = null; + } if (!id.charAt) throw new Error("worker.js require() accepts only (parentId, id) as arguments"); @@ -58,7 +62,7 @@ window.require = function(parentId, id) { require.id = id; importScripts(path); - return require(parentId, id); + return require(parentId, id); }; require.modules = {}; @@ -102,8 +106,8 @@ window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { window.initSender = function initSender() { - var EventEmitter = require(null, "ace/lib/event_emitter").EventEmitter; - var oop = require(null, "ace/lib/oop"); + var EventEmitter = require("ace/lib/event_emitter").EventEmitter; + var oop = require("ace/lib/oop"); var Sender = function() {}; @@ -145,9 +149,9 @@ window.onmessage = function(e) { } else if (msg.init) { initBaseUrls(msg.tlns); - require(null, "ace/lib/fixoldbrowsers"); + require("ace/lib/es5-shim"); sender = initSender(); - var clazz = require(null, msg.module)[msg.classname]; + var clazz = require(msg.module)[msg.classname]; main = new clazz(sender); } else if (msg.event && sender) {