As an artificat of compiling methods to named function expressions the function name is being considered a "local" binding in the function body. This means that we will throw errors anytime someone would want to create a new local binding with the same name. This is solved by assigning a symbol to function Identifiers that indicates that they should not be considered local bindings.
6 lines
45 B
JavaScript
6 lines
45 B
JavaScript
class A {
|
|
foo() {
|
|
const foo = 2;
|
|
}
|
|
}
|