(clazz)
| 259 | }; |
| 260 | |
| 261 | async function testFinalize (clazz) { |
| 262 | let finalizeCalled = false; |
| 263 | await testUtil.runGCTests([ |
| 264 | 'test finalize', |
| 265 | () => { |
| 266 | const finalizeCb = function (called) { |
| 267 | finalizeCalled = called; |
| 268 | }; |
| 269 | |
| 270 | // Scope Test instance so that it can be gc'd. |
| 271 | // eslint-disable-next-line no-new |
| 272 | (() => { new Test(finalizeCb); })(); |
| 273 | }, |
| 274 | () => assert.strictEqual(finalizeCalled, true) |
| 275 | ]); |
| 276 | } |
| 277 | |
| 278 | const testUnwrap = (obj, clazz) => { |
| 279 | obj.testSetter = 'unwrapTest'; |