This repository has been archived by the owner on Jul 13, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ES6 module handling update for deferred execution
- Loading branch information
1 parent
80e94b9
commit 4f915f4
Showing
10 changed files
with
159 additions
and
146 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
Loader: require('./loader.js'), | ||
Module: require('./module.js'), | ||
System: require('./system.js') | ||
Loader: require('./loader'), | ||
Module: require('./module'), | ||
System: require('./system') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +0,0 @@ | ||
(function (global) { | ||
var defineProperty; | ||
try { | ||
if (!!Object.defineProperty({}, 'a', {})) { | ||
defineProperty = Object.defineProperty; | ||
} | ||
} catch (e) { | ||
defineProperty = function (obj, prop, opt) { | ||
obj[prop] = opt.value || opt.get.call(obj); | ||
} | ||
} | ||
|
||
// Module Object | ||
function Module(obj) { | ||
if (typeof obj != 'object') | ||
throw new TypeError('Expected object'); | ||
|
||
if (!(this instanceof Module)) | ||
return new Module(obj); | ||
|
||
var self = this; | ||
for (var key in obj) { | ||
(function (key, value) { | ||
defineProperty(self, key, { | ||
configurable: false, | ||
enumerable: true, | ||
get: function () { | ||
return value; | ||
} | ||
}); | ||
})(key, obj[key]); | ||
} | ||
if (Object.preventExtensions) | ||
Object.preventExtensions(this); | ||
} | ||
// Module.prototype = null; | ||
|
||
if (typeof exports === 'object') { | ||
module.exports = Module; | ||
} | ||
|
||
global.Module || (global.Module = Module); | ||
global.ModulePolyfill = Module; | ||
|
||
})(typeof global !== 'undefined' ? global : this); | ||
Oops, something went wrong.