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

Commit 6187526

Browse files
committed
Merge pull request #457 from BennettJames/multiple_error_fix
Fix for error handling in latest version of traceur
2 parents e8874c0 + ab974e2 commit 6187526

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/transpiler.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ var transpile = (function() {
4747
return compiler.compile(source, filename);
4848
}
4949
catch(e) {
50-
// traceur throws an error array
51-
throw e[0];
50+
// on older versions of traceur (<0.9.3), an array of errors is thrown
51+
// rather than a single error.
52+
if (e.length) {
53+
throw e[0];
54+
}
55+
throw e;
5256
}
5357
}
5458

0 commit comments

Comments
 (0)