Index: lib/compat.js |
=================================================================== |
--- a/lib/compat.js |
+++ b/lib/compat.js |
@@ -16,18 +16,22 @@ |
*/ |
// |
// Module framework stuff |
// |
function require(module) |
{ |
- return require.scopes[module]; |
+ let result = require.scopes[module]; |
+ if (typeof result == "function" && !(module in require.loaded)) |
Sebastian Noack
2016/05/31 11:44:27
Where is it actually added to require.loaded?
Wladimir Palant
2016/05/31 13:47:54
I probably should have tested this code path :)
I
|
+ result = require.scopes[module] = result(); |
+ return result; |
} |
+require.loaded = Object.create(null); |
require.scopes = Object.create(null); |
function importAll(module, globalObj) |
{ |
var exports = require(module); |
for (var key in exports) |
globalObj[key] = exports[key]; |
} |