Logo
Explore Help
Sign In
1berry/nodejs
1
0
Fork 0
You've already forked nodejs
Code Issues Packages Projects Releases Wiki Activity
nodejs/test/parallel/test-vm-parse-abort-on-uncaught-exception.js

15 lines
309 B
JavaScript
Raw Normal View History

vm: never abort on caught syntax error Keep track of C++ `TryCatch` state to avoid aborting when an exception is thrown inside one, and re-throw in JS to make sure the exception is being picked up a second time by a second uncaught exception handler, if necessary. Add a bit of a hack to `AppendExceptionLine` to avoid overriding the line responsible for re-throwing the exception. PR-URL: https://github.com/nodejs/node/pull/17394 Fixes: https://github.com/nodejs/node/issues/13258 Reviewed-By: James M Snell <jasnell@gmail.com>
2017-11-29 20:55:43 +01:00
// Flags: --abort-on-uncaught-exception
'use strict';
require('../common');
const vm = require('vm');
// Regression test for https://github.com/nodejs/node/issues/13258
try {
new vm.Script({ toString() { throw new Error('foo'); } }, {});
} catch (err) {}
try {
new vm.Script('[', {});
} catch (err) {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 1341ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API