Both properties are vestigial, from the days of require.async.  It was
necessary to keep track of whether or not a module had finished, and
whether all of its children had finished, before returning to the
callback.

It doesn't look like much from the usage:

require.async("some-module", function (er, someModule) {
 ...
})

and I'm sure someone from the AMD crowd will pipe in here about how
easy it can be.

However, this adds a lot of subtle complexity.  If some-module
requires some other things asynchronously, then it can create loops,
and we need to be able to detect those, and not call the cb until
everything is done loading and has exited.


On Sat, Mar 10, 2012 at 10:41, Nathan Rajlich <[email protected]> wrote:
> A quick look in module.js and grep through lib/ shows that they're never 
> used...
>
> On Sat, Mar 10, 2012 at 10:38 AM, Mark Volkmann
> <[email protected]> wrote:
>> The module object has these seven properties: exports, parent,
>> filename, paths, loaded, exited and children. In some sample code I
>> wrote, I see that the first five are getting set. However, it's not
>> clear to me when exited and children are set. I expected that
>> module.children would be an array of the modules that module had
>> required, but it's always empty in my code. Do those properties really
>> get set? If so, what triggers module.exited to get set to true?
>>
>> --
>> R. Mark Volkmann
>> Object Computing, Inc.
>>
>> --
>> Job Board: http://jobs.nodejs.org/
>> Posting guidelines: 
>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>> You received this message because you are subscribed to the Google
>> Groups "nodejs" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: 
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to