You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Engine produces a misleading error when encountering certain class shapes #67180
Linux <omitted-hostname> 7.0.0-38-generic #38~24.04.4-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 14 16:37:11 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
Might be "ParserBase" and "ParseClassLiteralBody" of "deps/v8/src/parsing". Still not sure though because I didn't investigate deeply and I am unfamiliar with the overall architecture of the project.
How often does it reproduce? Is there a required condition?
For the misleading error to occur, private field has to be declared after a method that uses it. Declaring the field before the method that uses it fixes the issue. In my tests, nesting didn't matter. However, I have been coming across this issue since long ago and nuances may differ from one version or platform to another one.
What is the expected behavior? Why is that the expected behavior?
Parsing is supposed to result in redeclaration of const y error. Order of private field declaration in comparison to order of a method that uses it does not prove field being undefined at the whole class body. Therefore the behaviour specified above is a bug that misleads the developer.
What do you see instead?
Parsing results in Private field '#_x_' must be declared in an enclosing class error, which is misleading. Because the order of field declaration aborts the parsing phase, inner errors get skipped. In cases where faulty code is absent within a class body, development is even more enigmatic especially when working on big classes.
Activity