[parser] Use scope flags to check arguments (#10801)
* chore: add test case Co-authored-by: Jens Maier<jens@elberet.de> * use scope flags to check arguments
This commit is contained in:
committed by
Nicolò Ribaudo
parent
a0bed42aec
commit
c6e966cac9
@@ -2208,7 +2208,11 @@ export default class ExpressionParser extends LValParser {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.state.inClassProperty && word === "arguments") {
|
||||
if (
|
||||
this.scope.inClass &&
|
||||
!this.scope.inNonArrowFunction &&
|
||||
word === "arguments"
|
||||
) {
|
||||
this.raise(
|
||||
startLoc,
|
||||
"'arguments' is not allowed in class field initializer",
|
||||
|
||||
Reference in New Issue
Block a user