Closed johnjbarton closed 10 years ago
Why not new Module
?
Yeah. It used to be new Module
, and people on TC39 complained that that suggests prototype inheritance, which modules don't have.
If you care about this, es-discuss is good for bikeshedding of this kind. @dherman suggests maybe Reflect.module()
is the right color.
By a wide margin JS developers use Capital names for constructors. The Module Factory function is not a constructor, has no prototype, and is not to be called with 'new'. Ergo it should not be 'Module( obj )'. Lower case would just be confusing.
Note: The Module factory function reflectively creates module instance objects.
IMO this is an action function that calls for an action name: createModule(), coatModule(), createModuleInstance().