-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
mjs module looks like:
var Module = (() => {
var _scriptDir = import.meta.url;
return (
async function(Module = {}) {
var Module = typeof Module != "undefined" ? Module : {};
// module stuff
}
);
})();
export default Module;There are a few problems with this:
- Safari doesn't understands this and I truly believe the cause is a Safari bug (tested under Safari 16.4 MacOS / iOS)
- Default argument value assumes that argument is defined
- Hoisting doesn't work here, es module provides module scope
You could really name things better. The first Module actually is a factory that generates a Module, the second one is Module closure and the third one is the Module, which is the factory result.
ivancuric and MilenMetodiev
Metadata
Metadata
Assignees
Labels
No labels