1'use strict'; 2// Flags: --expose-gc 3 4const common = require('../../common'); 5const assert = require('assert'); 6const addon = require(`./build/${common.buildType}/8_passing_wrapped`); 7 8async function runTest() { 9 let obj1 = addon.createObject(10); 10 let obj2 = addon.createObject(20); 11 const result = addon.add(obj1, obj2); 12 assert.strictEqual(result, 30); 13 14 // Make sure the native destructor gets called. 15 obj1 = null; 16 obj2 = null; 17 await common.gcUntil('8_passing_wrapped', 18 () => (addon.finalizeCount() === 2)); 19} 20runTest(); 21