From b9ea0e4108518f73170c2fd4e72b5a0699076bb3 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Mon, 25 Nov 2019 06:48:17 +0100 Subject: [PATCH] Remove unneeded checks --- src/ast/scopes/ChildScope.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ast/scopes/ChildScope.ts b/src/ast/scopes/ChildScope.ts index 5ee4a2b2288..0fbd03b9930 100644 --- a/src/ast/scopes/ChildScope.ts +++ b/src/ast/scopes/ChildScope.ts @@ -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) { @@ -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 {