Skip to content

Commit

Permalink
fix: make the mf.registers behave like an object literal
Browse files Browse the repository at this point in the history
  • Loading branch information
arnog committed Jul 17, 2024
1 parent 731eb8d commit 2887710
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/public/mathfield-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,19 @@ import 'https://unpkg.com/@cortex-js/compute-engine?module';
});
return true;
},
ownKeys: (): Array<string | symbol> =>
Reflect.ownKeys(that._getOption('registers')),
getOwnPropertyDescriptor: (_, prop) => {
const value = that._getOption('registers')[prop as string];
if (value !== undefined) {
return {
configurable: true,
enumerable: true,
value,
writable: true,
};
}
},
}
);
}
Expand Down

0 comments on commit 2887710

Please sign in to comment.