mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
484 B
22 lines
484 B
'use strict';
|
|
const common = require('../../common');
|
|
const assert = require('assert');
|
|
const addon = require(`./build/${common.buildType}/binding`);
|
|
|
|
addon.RunCallback(function(msg) {
|
|
assert.strictEqual(msg, 'hello world');
|
|
});
|
|
|
|
function testRecv(desiredRecv) {
|
|
addon.RunCallbackWithRecv(function() {
|
|
assert.strictEqual(this, desiredRecv);
|
|
}, desiredRecv);
|
|
}
|
|
|
|
testRecv(undefined);
|
|
testRecv(null);
|
|
testRecv(5);
|
|
testRecv(true);
|
|
testRecv('Hello');
|
|
testRecv([]);
|
|
testRecv({});
|
|
|