This file contains 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 Q = require("events"); | |
exports.and = function (a, b) { | |
return Q.when(a, function (a) { | |
return Q.when(b, function (b) { | |
return a && b; | |
}); | |
}); | |
}; |
This file contains 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 app = function (request) { | |
return { | |
"status": 200, | |
"headers": {"Content-type": "text/plain" }, | |
"body": ["Hello, World!\n"] | |
}; | |
}; | |
var app = function (request) { |
This file contains 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.ContentLengthMiddleware = function (app) { | |
return function (request) { | |
return Q.when(app(request), function (response) { | |
var stream = new ByteIO(); | |
var write = function (line) { | |
stream.write(line.toByteString("utf-8")); | |
}; | |
return Q.when(response.body.forEach(write), function () { | |
var content = stream.read(); |
This file contains 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
// EXAMPLE 1 | |
// PSGI equivalent | |
var app = function(env) { | |
return function(respond) { | |
// do some event stuff | |
setTimeout(function() { | |
respond({ status : code, headers : headers, body : body }); | |
}, 1000); | |
} |
This file contains 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
using System; | |
namespace Pastebin | |
{ | |
class Pbcopy | |
{ | |
[STAThread] | |
static void Main(string[] args) | |
{ | |
try |
This file contains 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
+ Running | |
+ Running test sputnik/15.9.2_The_Date_Constructor_Called_as_a_Function/S15.9.2.1_A1.js | |
+ Running test sputnik/15.9.2_The_Date_Constructor_Called_as_a_Function/S15.9.2.1_A2.js | |
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T1.js | |
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T2.js | |
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T3.js | |
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T4.js | |
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T5.js | |
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A1_T6.js | |
+ Running test sputnik/15.9.3_The_Date_Constructor/S15.9.3.1_A2_T1.js |
This file contains 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
+ Running | |
+ Running testReflexiveParseFormat 2010-01-01T00:00:00.000Z | |
+ Running testNonReflexiveParseFormat 2010 | |
+ Running testNonReflexiveParseFormat 2010-01 | |
+ Running testNonReflexiveParseFormat 2010-01-01 | |
+ Running testNonReflexiveParseFormat 2010-01-01T00:00Z | |
+ Running testNonReflexiveParseFormat 2010-01-01T00:00:00Z | |
+ Running testNonReflexiveParseFormat 2010-01-01T00:00:00.000Z | |
+ Running testNonReflexiveParseFormat 2010-01-01T00:00:00.000+01:01 | |
+ Running testNonReflexiveParseFormat 0010 |
This file contains 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 SYSTEM = require("system"); | |
var allInput = SYSTEM.stdin.read(); | |
SYSTEM.stdout.write("someOutput"); | |
var FS = require("fs"); | |
FS.write("path/to/file", "allOfFileData"); | |
var allOfFile = FS.read("path/to/file"); |
This file contains 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
function genericLoad(id, baseId) { | |
id = resolve(id, baseId); | |
let text = fetch(id); | |
return new Function("require", "exports", "module", text); | |
} | |
let memo = {}; | |
function genericRequire(id, baseId) { | |
id = resolve(id, baseId); |
This file contains 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 delay = function (timeout) { | |
var deferred = new Deferred(); | |
setTimeout(function () { | |
deferred.resolve(); | |
}, timeout); | |
return deferred.promise; | |
}; | |
delay(1000).then(function () { |