Skip to content

Commit

Permalink
fix: remove unnecessary property descriptor spread (#4403)
Browse files Browse the repository at this point in the history
* fix: remove unnecessary property descriptor spread

* Simplify import

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
  • Loading branch information
3 people committed Feb 14, 2022
1 parent 61d6820 commit 69eb721
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion src/ExternalModule.ts
Expand Up @@ -73,7 +73,6 @@ export default class ExternalModule {
});
// Hide the deprecated key so that it only warns when accessed explicitly
Object.defineProperty(this.info, 'hasModuleSideEffects', {
...Object.getOwnPropertyDescriptor(this.info, 'hasModuleSideEffects'),
enumerable: false
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/Module.ts
Expand Up @@ -5,6 +5,7 @@ import MagicString from 'magic-string';
import ExternalModule from './ExternalModule';
import type Graph from './Graph';
import { createHasEffectsContext, createInclusionContext } from './ast/ExecutionContext';
import { nodeConstructors } from './ast/nodes';
import ExportAllDeclaration from './ast/nodes/ExportAllDeclaration';
import ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration';
import type ExportNamedDeclaration from './ast/nodes/ExportNamedDeclaration';
Expand All @@ -17,7 +18,6 @@ import * as NodeType from './ast/nodes/NodeType';
import Program from './ast/nodes/Program';
import TemplateLiteral from './ast/nodes/TemplateLiteral';
import VariableDeclaration from './ast/nodes/VariableDeclaration';
import { nodeConstructors } from './ast/nodes/index';
import type { ExpressionNode, NodeBase } from './ast/nodes/shared/Node';
import ModuleScope from './ast/scopes/ModuleScope';
import { type PathTracker, UNKNOWN_PATH } from './ast/utils/PathTracker';
Expand Down Expand Up @@ -335,7 +335,6 @@ export default class Module {
};
// Hide the deprecated key so that it only warns when accessed explicitly
Object.defineProperty(this.info, 'hasModuleSideEffects', {
...Object.getOwnPropertyDescriptor(this.info, 'hasModuleSideEffects'),
enumerable: false
});
}
Expand Down

0 comments on commit 69eb721

Please sign in to comment.