Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Fix for error handling in latest version of traceur #457

Merged
merged 1 commit into from
Dec 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/transpiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ var transpile = (function() {
return compiler.compile(source, filename);
}
catch(e) {
// traceur throws an error array
throw e[0];
// on older versions of traceur (<0.9.3), an array of errors is thrown
// rather than a single error.
if (e.length) {
throw e[0];
}
throw e;
}
}

Expand Down