Hi Calvin,
On 21 juil. 2014, at 17:16, Calvin Metcalf
<[email protected]<mailto:[email protected]>> wrote:
I have a CommonJS module which exports a single function
```js
//cj.js
module.exports = function (){}
```
Just to be exact this wouldn't be exactly a "CommonJS" module
http://wiki.commonjs.org/wiki/Modules
module.exports isn't part of any of the 1.0, 1.1, or 1.1.1 versions of the
CommonJS modules specification
CommonJS doesn't support neither to replace the original exports object
reference by another, so:
```js
exports = function (){}
```
First implemented in node.js, then in few SSJS implementations to better
support node modules
it never was accepted as part of the standard, because considered as too error
prone
https://groups.google.com/forum/#!searchin/commonjs/cyclic/commonjs/DECN5h4Lfms/-BrIu7TpKQkJ
and is still not supported by some other CommonJS implementations
[cid:[email protected]]
Alexandre Morgaut
Wakanda Community Manager
Email : [email protected]<mailto:[email protected]>
Web : www.4D.com<http://www.4D.com>
4D SAS
60, rue d'Alsace
92110 Clichy - France
Standard : +33 1 40 87 92 00
[cid:[email protected]]<http://www.4d.com/fr/company/events/summiteu2014.html>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss