Skip to content

Commit

Permalink
Remove unneeded checks
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Nov 25, 2019
1 parent d7c988c commit b9ea0e4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ast/scopes/ChildScope.ts
Expand Up @@ -45,9 +45,7 @@ export default class ChildScope extends Scope {

addNamespaceMemberAccess(name: string, variable: Variable) {
this.accessedOutsideVariables.set(name, variable);
if (this.parent instanceof ChildScope) {
this.parent.addNamespaceMemberAccess(name, variable);
}
(this.parent as ChildScope).addNamespaceMemberAccess(name, variable);
}

addReturnExpression(expression: ExpressionEntity) {
Expand Down Expand Up @@ -97,7 +95,7 @@ export default class ChildScope extends Scope {
}

findLexicalBoundary(): ChildScope {
return this.parent instanceof ChildScope ? this.parent.findLexicalBoundary() : this;
return (this.parent as ChildScope).findLexicalBoundary();
}

findVariable(name: string): Variable {
Expand Down

0 comments on commit b9ea0e4

Please sign in to comment.