test: add test case for throwing an exception with vm.Script
It failed with `FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal`. PR-URL: https://github.com/nodejs/node/pull/17343 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
This commit is contained in:
parent
19221d1d6f
commit
4b30287966
14
test/parallel/test-vm-script-throw-in-tostring.js
Normal file
14
test/parallel/test-vm-script-throw-in-tostring.js
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
require('../common');
|
||||
const assert = require('assert');
|
||||
|
||||
const vm = require('vm');
|
||||
|
||||
assert.throws(() => {
|
||||
new vm.Script({
|
||||
toString() {
|
||||
throw new Error();
|
||||
}
|
||||
});
|
||||
}, Error);
|
Loading…
x
Reference in New Issue
Block a user