At least thats my understanding. This comment is a good starting
point: http://github.com/ry/node/blob/master/src/node.js#L759
-Russell
> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
That looks like a documentation bug, good catch.
-Russell
It shouldn't.
You should submit a patch.
--i
Thanks,
Vitali
> Can you print what the output for that test case is?
Yep, this is what it gives :-(
=== release test-next-tick-ordering ===
Path: simple/test-next-tick-ordering
Running from main.
Running from setTimeout 0
Running from setTimeout 1
Running from setTimeout 2
Running from setTimeout 3
Running from setTimeout 4
Running from setTimeout 5
Running from setTimeout 6
Running from setTimeout 7
Running from setTimeout 8
Running from setTimeout 9
Running from setTimeout 10
Running from setTimeout 11
Running from setTimeout 12
Running from setTimeout 13
Running from setTimeout 14
Running from setTimeout 15
Running from setTimeout 16
Running from setTimeout 17
Running from setTimeout 18
Running from setTimeout 19
Running from nextTick
Running from setTimeout 20
Running from setTimeout 21
Running from setTimeout 22
Running from setTimeout 23
Running from setTimeout 24
Running from setTimeout 25
Running from setTimeout 26
Running from setTimeout 27
Running from setTimeout 28
Running from setTimeout 29
assert:80
throw new assert.AssertionError({
^
AssertionError: 0 == "nextTick"
at EventEmitter.<anonymous> (/Users/jorge/JAVASCRIPT/node/test/simple/test-next-tick-ordering.js:28:10)
at EventEmitter.emit (events:26:26)
at node.js:775:9
Command: build/default/node /Users/jorge/JAVASCRIPT/node/test/simple/test-next-tick-ordering.js
--
Jorge.
> I'm not able to reproduce this with v0.2.0. What version are you
> running? Here's what I get:
For it to happen you've got to patch line 751 in node.js to read "process.nextTick(module.runMain);" : http://github.com/xk/node/commit/7fdb7cb46e8ab53528ac2a42f5907f6a93ebad58
--
Jorge.
Oh, well, maybe it's no longer @ line 751. This is it:
if (process.argv[1]) {
if (process.argv[1].charAt(0) != "/" && !(/^http:\/\//).exec(process.argv[1])) {
process.argv[1] = path.join(cwd, process.argv[1]);
}
//module.runMain(); // *** disable this
process.nextTick(module.runMain); // *** put this instead
} else {
// No arguments, run the repl
var repl = module.requireNative('repl');
console.log("Type '.help' for options.");
repl.start();
}
--
Jorge.
--
I added the broken test in 635986e4338cf34cf8e1abc4343ffd69d109bb4e
Rather than nextTick the loading, just load the main file
asynchronously. It breaks some things, and those issues need to be
worked out.