Migrate functionality from old stacktrace.js