1'use strict'; 2const common = require('../../common'); 3const assert = require('assert'); 4const addon = require(`./build/${common.buildType}/3_callbacks`); 5 6addon.RunCallback(function(msg) { 7 assert.strictEqual(msg, 'hello world'); 8}); 9 10function testRecv(desiredRecv) { 11 addon.RunCallbackWithRecv(function() { 12 assert.strictEqual(this, desiredRecv); 13 }, desiredRecv); 14} 15 16testRecv(undefined); 17testRecv(null); 18testRecv(5); 19testRecv(true); 20testRecv('Hello'); 21testRecv([]); 22testRecv({}); 23