From 3b8e42c48ff582974643fb1597e7fc58eab4b98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 19 Sep 2019 02:10:17 +0200 Subject: [PATCH] Fix flow --- packages/babel-parser/src/util/scope.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/babel-parser/src/util/scope.js b/packages/babel-parser/src/util/scope.js index 1e1a1153d190..a32d3b78d557 100644 --- a/packages/babel-parser/src/util/scope.js +++ b/packages/babel-parser/src/util/scope.js @@ -31,8 +31,6 @@ export class Scope { lexical: string[] = []; // A list of lexically-declared FunctionDeclaration names in the current lexical scope functions: string[] = []; - // A list of private names defined in the current class body - privateNames: string[] = []; constructor(flags: ScopeFlags) { this.flags = flags; @@ -40,10 +38,14 @@ export class Scope { } export class ClassScope { - privateNames: string[] = new Set(); + // A list of private named declared in the current class + privateNames: Set = new Set(); + // A list of private getters of setters without their counterpart loneAccessors: Map = new Map(); + // A list of private names used before being defined, mapping to + // their position. undefinedPrivateNames: Map = new Map(); } @@ -211,7 +213,7 @@ export default class ScopeHandler { } } - raiseUndeclaredPrivateName(name, pos) { + raiseUndeclaredPrivateName(name: string, pos: number) { this.raise(pos, `Private name #${name} is not defined`); }