V8: Error inside setImmediate which is inside a function breaks FormatStackTrace

1. FXServer version: 3551 on windows
2. What happens: If you throw an error inside setImmediate which is inside another function you call it will throw a bad cast error inside the FormatStackTrace function. Same shit happens to other js functions with callback, e.g. “setTimeout, setInterval,…”. This happened even before the other v8 changes!!!
3. Category of bug: Server (propably also client, didn’t test)
4. Reproducible steps, preferably with example script(s): Resource
badcast_error.rar (417 Bytes)
Or code:

Error.prepareStackTrace = null;

(() => {
	setImmediate(() => {
		console.log('throw error');
		throw Error('this shit will break the FormatStackTrace function for some reason');
	});
})();

I’m sorry for this bullying with v8 take your time

Resolved by not relying on a custom stack trace format anymore.

1 Like