-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/decorators): Use correct class name reference (#9375)
- Closes #9350
- Loading branch information
1 parent
a3a3040
commit badd6a9
Showing
7 changed files
with
99 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
swc_ecma_transforms_proposal: patch | ||
--- | ||
|
||
fix(es/decorator): Use correct class name reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsc": { | ||
"parser": { | ||
"syntax": "typescript", | ||
"decorators": true | ||
}, | ||
"target": "es2016" | ||
}, | ||
"module": { | ||
"type": "es6" | ||
}, | ||
"isModule": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function registerHook(key) { | ||
return (...args) => console.log(args); | ||
} | ||
|
||
export default function design(base: typeof Component) { | ||
return class Design extends base { | ||
copy() { | ||
console.log("copy"); | ||
} | ||
|
||
@registerHook("beforeRender") | ||
@registerHook("afterRender") | ||
render() { | ||
super.render(); | ||
console.log("design render"); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function registerHook(key) { | ||
return (...args) => console.log(args); | ||
} | ||
|
||
export default function design(base: typeof Component) { | ||
const Design = "test name conflict"; | ||
return class Design extends base { | ||
copy() { | ||
console.log("copy"); | ||
} | ||
|
||
@registerHook("beforeRender") | ||
@registerHook("afterRender") | ||
render() { | ||
super.render(); | ||
console.log("design render"); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate"; | ||
function registerHook(key) { | ||
return (...args)=>console.log(args); | ||
} | ||
export default function design(base) { | ||
var Design; | ||
return Design = class Design extends base { | ||
copy() { | ||
console.log("copy"); | ||
} | ||
render() { | ||
super.render(); | ||
console.log("design render"); | ||
} | ||
}, _ts_decorate([ | ||
registerHook("beforeRender"), | ||
registerHook("afterRender") | ||
], Design.prototype, "render", null), Design; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate"; | ||
function registerHook(key) { | ||
return (...args)=>console.log(args); | ||
} | ||
export default function design(base) { | ||
const Design = "test name conflict"; | ||
var Design1; | ||
return Design1 = class Design1 extends base { | ||
copy() { | ||
console.log("copy"); | ||
} | ||
render() { | ||
super.render(); | ||
console.log("design render"); | ||
} | ||
}, _ts_decorate([ | ||
registerHook("beforeRender"), | ||
registerHook("afterRender") | ||
], Design1.prototype, "render", null), Design1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters