Skip to content

Commit

Permalink
Fix flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 24, 2019
1 parent 2e7b0e5 commit 3b8e42c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/babel-parser/src/util/scope.js
Expand Up @@ -31,19 +31,21 @@ 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;
}
}

export class ClassScope {
privateNames: string[] = new Set();
// A list of private named declared in the current class
privateNames: Set<string> = new Set();

// A list of private getters of setters without their counterpart
loneAccessors: Map<string, ClassElementTypes> = new Map();

// A list of private names used before being defined, mapping to
// their position.
undefinedPrivateNames: Map<string, number> = new Map();
}

Expand Down Expand Up @@ -211,7 +213,7 @@ export default class ScopeHandler<IScope: Scope = Scope> {
}
}

raiseUndeclaredPrivateName(name, pos) {
raiseUndeclaredPrivateName(name: string, pos: number) {
this.raise(pos, `Private name #${name} is not defined`);
}

Expand Down

0 comments on commit 3b8e42c

Please sign in to comment.