mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 04:32:01 +03:00
33 lines
620 B
TypeScript
33 lines
620 B
TypeScript
// @allowJs: true
|
|
// @checkJs: true
|
|
// @target: es5
|
|
// @lib: es6
|
|
// @outDir: ./out
|
|
// @declaration: true
|
|
// @filename: index.js
|
|
const TopLevelSym = Symbol();
|
|
const InnerSym = Symbol();
|
|
module.exports = {
|
|
[TopLevelSym](x = 12) {
|
|
return x;
|
|
},
|
|
items: {
|
|
[InnerSym]: (arg = {x: 12}) => arg.x
|
|
}
|
|
}
|
|
|
|
// @filename: index2.js
|
|
const TopLevelSym = Symbol();
|
|
const InnerSym = Symbol();
|
|
|
|
export class MyClass {
|
|
static [TopLevelSym] = 12;
|
|
[InnerSym] = "ok";
|
|
/**
|
|
* @param {typeof TopLevelSym | typeof InnerSym} _p
|
|
*/
|
|
constructor(_p = InnerSym) {
|
|
// switch on _p
|
|
}
|
|
}
|