mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 17:41:40 +00:00

Tests relying on synchronous timing have been migrated to use events. PR-URL: https://github.com/nodejs/node/pull/17828 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
21 lines
611 B
JavaScript
21 lines
611 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
// This test ensures that the repl does not
|
|
// crash or emit error when throwing `null|undefined`
|
|
// ie `throw null` or `throw undefined`
|
|
|
|
const repl = require('repl');
|
|
|
|
const replserver = repl.start();
|
|
const $eval = replserver.eval;
|
|
replserver.eval = function(code, context, file, cb) {
|
|
return $eval.call(this, code, context, file,
|
|
common.mustNotCall(
|
|
'repl crashes/throw error on `throw null|undefined`'));
|
|
};
|
|
replserver.write('throw null\n');
|
|
replserver.write('throw undefined\n');
|
|
|
|
replserver.write('.exit\n');
|