Skip to content

Commit

Permalink
fix: support more environments (#5266)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Aug 1, 2023
1 parent 101e6e8 commit b196806
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Makefile.dryice.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,21 +781,27 @@ function namespace(ns) {
function exportAce(ns, modules, requireBase, extModules) {
requireBase = requireBase || "window";
return function(text) {
/*globals REQUIRE_NS, MODULES*/
/*globals REQUIRE_NS, MODULES, self*/
var template = function() {
(function() {
REQUIRE_NS.require(MODULES, function(a) {
if (a) {
a.config.init(true);
a.define = REQUIRE_NS.define;
}
if (!window.NS)
window.NS = a;
var global = (function () {
return this;
})();
if (!global && typeof window != "undefined") global = window; // can happen in strict mode
if (!global && typeof self != "undefined") global = self; // can happen in webworker

if (!global.NS)
global.NS = a;
for (var key in a) if (a.hasOwnProperty(key))
window.NS[key] = a[key];
window.NS["default"] = window.NS;
global.NS[key] = a[key];
global.NS["default"] = global.NS;
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = window.NS;
module.exports = global.NS;
}
});
})();
Expand Down

0 comments on commit b196806

Please sign in to comment.