08-27-周三_17-09-29

This commit is contained in:
2025-08-27 17:10:05 +08:00
commit 86df397d8f
12735 changed files with 1145479 additions and 0 deletions

38
node_modules/dnode/test/double.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
var dnode = require('../');
var test = require('tape');
test('double', function (t) {
t.plan(4);
var port = Math.floor(Math.random() * 40000 + 10000);
var server = dnode({
z : function (f, g, h) {
f(10, function (x) {
g(10, function (y) {
h(x,y)
})
})
}
});
var client = dnode();
client.on('remote', function (remote) {
remote.z(
function (x,f) { f(x * 2) },
function (x,f) { f(x / 2) },
function (x,y) {
t.equal(x, 20, 'double, not equal');
t.equal(y, 5, 'double, not equal');
}
);
function plusTen(n,f) { f(n + 10) }
remote.z(plusTen, plusTen, function (x,y) {
t.equal(x, 20, 'double, equal');
t.equal(y, 20, 'double, equal');
});
});
client.pipe(server).pipe(client);
});