Throw an error for a declare class field that have an initializer (#12093)

This commit is contained in:
Sosuke Suzuki
2020-09-22 22:23:58 +09:00
committed by GitHub
parent 3628c52867
commit cb4e436018
2 changed files with 4 additions and 1 deletions

View File

@@ -2281,7 +2281,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
parseClassProperty(node: N.ClassProperty): N.ClassProperty {
this.parseClassPropertyAnnotation(node);
if (node.declare && this.match(tt.equal)) {
if (node.declare && this.match(tt.eq)) {
this.raise(this.state.start, TSErrors.DeclareClassFieldHasInitializer);
}