(binding)
| 128 | ); |
| 129 | } |
| 130 | async function test (binding) { |
| 131 | const e = new Error('foobar'); |
| 132 | const functionMayThrow = () => { |
| 133 | throw e; |
| 134 | }; |
| 135 | const classMayThrow = class { |
| 136 | constructor () { |
| 137 | throw e; |
| 138 | } |
| 139 | }; |
| 140 | |
| 141 | const newRef = binding.CreateFuncRefWithNew(120); |
| 142 | assert(newRef.getValue() === 120); |
| 143 | |
| 144 | const newRefWithVecArg = binding.CreateFuncRefWithNewVec(80); |
| 145 | assert(newRefWithVecArg.getValue() === 80); |
| 146 | |
| 147 | assert.throws(() => { |
| 148 | binding.call(functionMayThrow); |
| 149 | }, /foobar/); |
| 150 | assert.throws(() => { |
| 151 | binding.construct(classMayThrow); |
| 152 | }, /foobar/); |
| 153 | |
| 154 | canConstructRefFromExistingRef(binding); |
| 155 | canCallFunctionWithDifferentOverloads(binding); |
| 156 | await canCallAsyncFunctionWithDifferentOverloads(binding); |
| 157 | } |
no test coverage detected