From f4766a6262b85eff404a888a929b52319d1da404 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Sat, 15 May 2021 07:24:46 +0200 Subject: [PATCH] Simplify namespace handling --- src/ast/values.ts | 1 - src/ast/variables/NamespaceVariable.ts | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/src/ast/values.ts b/src/ast/values.ts index f05f1ab700b..30866c41324 100644 --- a/src/ast/values.ts +++ b/src/ast/values.ts @@ -235,7 +235,6 @@ export function hasMemberEffectWhenCalled( EMPTY_PATH, { args: NO_ARGS, - // TODO Lukas think about this thisParam: null, withNew: false }, diff --git a/src/ast/variables/NamespaceVariable.ts b/src/ast/variables/NamespaceVariable.ts index 0f94f09910f..c81cff49892 100644 --- a/src/ast/variables/NamespaceVariable.ts +++ b/src/ast/variables/NamespaceVariable.ts @@ -3,7 +3,6 @@ import { RenderOptions } from '../../utils/renderHelpers'; import { RESERVED_NAMES } from '../../utils/reservedNames'; import { getSystemExportStatement } from '../../utils/systemJsRendering'; import Identifier from '../nodes/Identifier'; -import { ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker'; import Variable from './Variable'; export default class NamespaceVariable extends Variable { @@ -29,22 +28,6 @@ export default class NamespaceVariable extends Variable { this.name = identifier.name; } - deoptimizePath(path: ObjectPath) { - const memberVariables = this.getMemberVariables(); - const memberPath = path.length <= 1 ? UNKNOWN_PATH : path.slice(1); - const key = path[0]; - if (typeof key === 'string') { - memberVariables[key]?.deoptimizePath(memberPath); - } else { - for (const key of Object.keys(memberVariables)) { - memberVariables[key].deoptimizePath(memberPath); - } - } - } - - // TODO Lukas can this be triggered for nested paths? - deoptimizeThisOnEventAtPath() {} - getMemberVariables(): { [name: string]: Variable } { if (this.memberVariables) { return this.memberVariables;