Skip to content

Commit

Permalink
fix: don't redefine property
Browse files Browse the repository at this point in the history
  • Loading branch information
2heal1 committed Jun 4, 2024
1 parent a7d233c commit 42cecc0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtime/src/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ class Module {
id: string,
) {
function defineModuleId(res: any, id: string) {
if (res && typeof res === 'object') {
if (
res &&
typeof res === 'object' &&
!Object.getOwnPropertyDescriptor(res, Symbol.for('mf_module_id'))
) {
Object.defineProperty(res, Symbol.for('mf_module_id'), {
value: id,
enumerable: false,
Expand Down

0 comments on commit 42cecc0

Please sign in to comment.