This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var posix = require("posix"); | |
| var print = require("sys").puts; | |
| var j = 0; | |
| for(var i = 0;i < 100; i++){ | |
| posix.stat("file" + i, process.O_RDONLY, 0666) // these files don't exist | |
| .addErrback(function(e){ | |
| j++; // only makes it to about 17 | |
| print(j); | |
| }) | |
| .addCallback(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require.paths.push("../folder2"); | |
| require("b"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.name = "test"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var promise = new process.Promise(); | |
| promise.then(function(){ | |
| require("sys").puts("done"); | |
| }); | |
| promise.emit("success"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require.paths.push("."); | |
| exports.test = { | |
| get foo(){ | |
| require("c"); | |
| } | |
| }; | |
| require("a"); // a is just empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| throw new Error("some error"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("sys").puts("a is loaded"); |
NewerOlder