Skip to content

Instantly share code, notes, and snippets.

View kriszyp's full-sized avatar
💭
Working on @HarperFast

Kris Zyp kriszyp

💭
Working on @HarperFast
View GitHub Profile
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(){
require.paths.push("../folder2");
require("b");
exports.name = "test";
var promise = new process.Promise();
promise.then(function(){
require("sys").puts("done");
});
promise.emit("success");
require.paths.push(".");
exports.test = {
get foo(){
require("c");
}
};
require("a"); // a is just empty
throw new Error("some error");
require("sys").puts("a is loaded");