-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
'eval var' in class method not work #28174
Comments
Class methods are implicitly executed in strict mode and in strict mode |
So this in the main script scope should work?
because that still gives me a ReferenceError. |
That should give you a ReferenceError. |
Ah, I thought eval ran the code in the current scope, but it doens't fully then? |
IIUC, it runs in the current local scope (unless, for example, invoked by a reference, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description) but it creates its own block scope inside of that. So |
Code:
Expected result
But received
The text was updated successfully, but these errors were encountered: