Skip to content

Commit

Permalink
Simplify namespace handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed May 15, 2021
1 parent 275946e commit f4766a6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/ast/values.ts
Expand Up @@ -235,7 +235,6 @@ export function hasMemberEffectWhenCalled(
EMPTY_PATH,
{
args: NO_ARGS,
// TODO Lukas think about this
thisParam: null,
withNew: false
},
Expand Down
17 changes: 0 additions & 17 deletions src/ast/variables/NamespaceVariable.ts
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit f4766a6

Please sign in to comment.