swc/ecmascript/transforms/optimization/tests/expr-simplifier/issue-1846/fcase1/output.js
강동윤 204a71ca94
fix(es/transforms): Fix bugs (#1950)
swc_ecma_trasnsforms_base:
 - `fixer`: Don't de-optimize `++foo || bar`.

swc_ecma_trasnsforms_typescript:
 - Allow using properties from a decorated class. (#1869)

swc_ecma_transforms_optimization:
 - Fix infinite loop. (#1901, #1946)
2021-07-22 07:33:00 +00:00

25 lines
588 B
JavaScript

import "reflect-metadata";
const Test = (target)=>{
const metadata = Reflect.getMetadataKeys(target).reduce((metadata, key)=>{
const { [key]: values = [] } = metadata;
const all = Reflect.getMetadata(key, target);
const own = Reflect.getOwnMetadata(key, target);
return {
...metadata,
[key]: [
{
all,
own
},
...values
]
};
}, {
});
console.dir(metadata, {
depth: 5
});
};
export class Foo {
}