2017-10-28 16:19:53 +00:00
|
|
|
'use strict';
|
2018-02-11 19:17:03 +01:00
|
|
|
require('../common');
|
2017-10-28 16:19:53 +00:00
|
|
|
|
|
|
|
// This test ensures that the repl does not
|
|
|
|
// crash or emit error when throwing `null|undefined`
|
2018-02-09 02:32:04 +01:00
|
|
|
// ie `throw null` or `throw undefined`.
|
2017-10-28 16:19:53 +00:00
|
|
|
|
2018-02-09 02:32:04 +01:00
|
|
|
const r = require('repl').start();
|
2018-02-11 19:17:03 +01:00
|
|
|
|
2018-02-09 02:32:04 +01:00
|
|
|
// Should not throw.
|
|
|
|
r.write('throw null\n');
|
|
|
|
r.write('throw undefined\n');
|
2018-02-11 19:17:03 +01:00
|
|
|
r.write('.exit\n');
|