Skip to content

Commit

Permalink
fixup! timers: fix arbitrary object clearImmediate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkgoron committed Mar 20, 2021
1 parent f0f059f commit f444985
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/parallel/test-repl-clear-immediate-crash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';
const common = require('../common');
const child_process = require('child_process');
const assert = require('assert');

// Regression test for https://github.com/nodejs/node/issues/37806:
const proc = child_process.spawn(process.execPath, ['-i']);
proc.on('error', common.mustNotCall());
proc.on('exit', common.mustCall((code) => {
assert.strictEqual(code, 0);
}));
proc.stdin.write('clearImmediate({});\n.exit\n');
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';
require('../common');

// This test makes sure clearing timers with
// objects doesn't throw
clearImmediate({});
clearTimeout({});
clearInterval({});

0 comments on commit f444985

Please sign in to comment.