make work in non-V8 js runtimest > check if error.captureStackTrace() exists before calling it