-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError: use before declaration in Edge #59
Comments
I have a minimal repro, it requires several conditions to trigger the bug, notably nested lambdas. function g(cb) { return g() }
let f = ({ x }) => g(() => x);
f({ x: 42 }); // should return 42 but throws "use before declaration". |
Found a relevant Chakra bug: chakra-core/ChakraCore#2606. |
We don't need the lambda, we can use function notation if it's going to help, since we only use the scope anyway (no |
The bug is not hard to work around as it's very sensible to syntax. Even just adding braces (block) make it vanish. If we publish a fix the hardest part is making sure minifiers don't simplify the syntax back to broken. For instance, if we add braces or It was not a hard catch as unfortunately now Aurelia ES6 does not run at all in Edge. 😦 |
@EisenbergEffect do you want to publish a fix? I can PR one if you want to. |
Oh, definitely. If you send a PR I'll get it out today. |
See aurelia#59 and chakra-core/ChakraCore#2606 for details.
@EisenbergEffect The fix is in the linked PR, it works for me. |
Merged. |
Release coming in a few minutes. |
The ES2015 distribution of
aurelia-bootstrapper
triggers an error in Edge: "ReferenceError: use before declaration". And then the application doesn't start.I did test before and never noticed that, so I wonder if it is an Edge regression in a recent update.
I have Edge 14.14393, I would be interested in other people testing this.
The offending code is line 126:
And
Aurelia
is the variable that Edge complains about.The code above looks fine to me (given that
then
is called with an object that contains anAurelia
property).It runs fine in Firefox and according to Kangax tables it should be supported in Edge as well.
Just changing the code as follows work.
So I'd say this is more of an Edge bug, but since it impacts us it's good to know.
The text was updated successfully, but these errors were encountered: