Skip to content

Commit

Permalink
test: add test case for throwing an exception with vm.Script
Browse files Browse the repository at this point in the history
It failed with `FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal`.

PR-URL: #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>
  • Loading branch information
Leko authored and MylesBorins committed Dec 12, 2017
1 parent 419cde7 commit f060881
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/parallel/test-vm-script-throw-in-tostring.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit f060881

Please sign in to comment.