-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
let
assigment breaks typeof
#33462
Comments
Duplicate of #8309, albeit a much more confusing one. |
Also, you've technically found a bug in firefox. If you feel like it you can report it here: https://bugzilla.mozilla.org/ |
@mariorodriguespt it should be throwing in firefox. This is the same case as |
It is not throwing on Firefox and it is correct. On your example, Firefox does throw an error: As far as I can tell, V8 is not handling this correctly: The assignment failed but the |
When you do |
Just opened a bug on Firefox, I'll leave the link for those interested in the follow up: https://bugzilla.mozilla.org/show_bug.cgi?id=1639078 |
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Every single time. If you use
let
to define a variable and in the assignment part you check if the same variable exists, you won't be able to usetypeof
after.What is the expected behavior?
I would expect
typeof
should always work regardless of the variablea
existing or not.What do you see instead?
Uncaught ReferenceError: a is not defined
Additional information
This appear to be an issue in Chromium since it works as expected in Firefox.
The text was updated successfully, but these errors were encountered: