Skip to content

Commit f444985

Browse files
committed
fixup! timers: fix arbitrary object clearImmediate errors
1 parent f0f059f commit f444985

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
const common = require('../common');
3+
const child_process = require('child_process');
4+
const assert = require('assert');
5+
6+
// Regression test for https://github.com/nodejs/node/issues/37806:
7+
const proc = child_process.spawn(process.execPath, ['-i']);
8+
proc.on('error', common.mustNotCall());
9+
proc.on('exit', common.mustCall((code) => {
10+
assert.strictEqual(code, 0);
11+
}));
12+
proc.stdin.write('clearImmediate({});\n.exit\n');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
require('../common');
3+
4+
// This test makes sure clearing timers with
5+
// objects doesn't throw
6+
clearImmediate({});
7+
clearTimeout({});
8+
clearInterval({});

0 commit comments

Comments
 (0)