steal-es6-module-loader
Version:
An ES6 Module Loader shim
17 lines (14 loc) • 662 B
JavaScript
// Define our eval outside of the scope of any other reference defined in this
// file to avoid adding those references to the evaluation scope.
function __eval(__source, __global, __load) {
try {
eval('(function() { var __moduleName = "' + (__load.name || '').replace('"', '\"') + '"; ' + __source + ' \n }).call(__global);');
}
catch(e) {
if (e.name == 'SyntaxError' || e.name == 'TypeError')
e.message = 'Evaluating ' + (__load.name || load.address) + '\n\t' + e.message;
throw e;
}
}
})(typeof window != 'undefined' ? window : (typeof WorkerGlobalScope != 'undefined' ?
self : global));