On 24 July 2012 05:03, Claus Reinke <[email protected]> wrote:
> Hm, I hadn't thought about that, but my intuition tells me that
> there should be an export object for every module, with just the
> exports, and that this export object should be accessible from the module
> object.
>
Being able to access the export object from the module object enables a
pattern we use locally, which is roughly
require("myModule").configParameter = xyz;
or
require("myModule").errorReporter = function(err){alert(err)};
exports.errorReporter, exports.configParameter are then used heavily within
the module -- normally, they are not even set by the user, but they there
in case the user needs to override some behaviour.
Wes
--
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss