Merge pull request #3363 from danez/patch-1

fix(babel-template): Fix Error in IE <= 9
This commit is contained in:
Amjad Masad 2016-03-07 18:35:27 -08:00
commit 891becffc1

View File

@ -18,7 +18,10 @@ export default function (code: string, opts?: Object): Function {
// error stack gets populated in IE only on throw (https://msdn.microsoft.com/en-us/library/hh699850(v=vs.94).aspx)
throw new Error();
} catch (error) {
stack = error.stack.split("\n").slice(1).join("\n");
if (error.stack) {
// error.stack does not exists in IE <= 9
stack = error.stack.split("\n").slice(1).join("\n");
}
}
let getAst = function () {