summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-throw-null-or-undefined.js
blob: 3b4657ce98c0f3c2175d6d265a8f1d80830ea733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'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 r = require('repl').start();

// Should not throw.
r.write('throw null\n');
r.write('throw undefined\n');
r.write('.exit\n');