Null checking new Error().stack;

In Safari and/or iOS Safari, (new Error().stack) throws an undefined exception. Using new Error().toString() as a backup.