From 8a5b2ac2b070d40ebab6c8ee4a3c2a007ad9eb4e Mon Sep 17 00:00:00 2001 From: Leko Date: Tue, 28 Nov 2017 23:13:38 +0900 Subject: [PATCH] test: add test case for throwing an exception with vm.Script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It failed with `FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal`. PR-URL: https://github.com/nodejs/node/pull/17343 Reviewed-By: Ben Noordhuis Reviewed-By: Michaƫl Zasso Reviewed-By: Joyee Cheung Reviewed-By: Yuta Hiroto Reviewed-By: Anna Henningsen Reviewed-By: Daijiro Wachi --- test/parallel/test-vm-script-throw-in-tostring.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/parallel/test-vm-script-throw-in-tostring.js diff --git a/test/parallel/test-vm-script-throw-in-tostring.js b/test/parallel/test-vm-script-throw-in-tostring.js new file mode 100644 index 00000000000000..20e7a75079b33c --- /dev/null +++ b/test/parallel/test-vm-script-throw-in-tostring.js @@ -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);