forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
21 lines (18 loc) · 637 Bytes
/
Copy pathtest.js
File metadata and controls
21 lines (18 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
// Flags: --expose-gc
const common = require('../../common');
const assert = require('assert');
const test_exception = require(`./build/${common.buildType}/test_exception`);
// Make sure that exceptions that occur during finalization are propagated.
function testFinalize(binding) {
let x = test_exception[binding]();
x = null;
global.gc();
process.on('uncaughtException', (err) => {
// eslint-disable-next-line node-core/must-call-assert
assert.strictEqual(err.message, 'Error during Finalize');
});
// To assuage the linter's concerns.
(function() {})(x);
}
testFinalize('createExternalBuffer');