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

This reverts commit de848ac1e0
.
The commit broke multiline repl.
PR-URL: https://github.com/nodejs/node/pull/18715
Refs: https://github.com/nodejs/node/pull/17828
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
19 lines
443 B
JavaScript
19 lines
443 B
JavaScript
'use strict';
|
|
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 assert = require('assert');
|
|
const repl = require('repl');
|
|
|
|
const r = repl.start();
|
|
|
|
assert.doesNotThrow(() => {
|
|
r.write('throw null\n');
|
|
r.write('throw undefined\n');
|
|
}, TypeError, 'repl crashes/throw error on `throw null|undefined`');
|
|
|
|
r.write('.exit\n');
|