fix(decorators): Add Symbol.metadata polyfill and import it at entry to ensure decorator metadata is available

This commit is contained in:
2025-11-28 09:16:52 +00:00
parent 23aa29a5b8
commit 0a349180b2
5 changed files with 22 additions and 6 deletions

6
ts/shim.ts Normal file
View File

@@ -0,0 +1,6 @@
/**
* Polyfill for Symbol.metadata required by TC39 Stage 3 decorators.
* Must be imported before any decorator code loads.
* @see https://github.com/tc39/proposal-decorator-metadata
*/
(Symbol as any).metadata ??= Symbol.for('Symbol.metadata');