@@ -5,6 +5,7 @@ export type StringToArrayMap = {
55}
66
77export type ReflectionMap = {
8+ constructor : Array < string > ,
89 instance : StringToArrayMap ,
910 static : StringToArrayMap
1011}
@@ -20,13 +21,19 @@ export function copyReflectionMetadata(
2021) {
2122 shallowCopy ( from . prototype , to . prototype , reflectionMap . instance )
2223 shallowCopy ( from , to , reflectionMap . static )
24+ shallowCopy ( from , to , { 'constructor' : reflectionMap . constructor } )
2325}
2426
2527function shallowCopy ( from : VueConstructor , to : VueConstructor , propertyKeys : StringToArrayMap ) {
2628 for ( const propertyKey in propertyKeys ) {
2729 propertyKeys [ propertyKey ] . forEach ( ( metadataKey ) => {
28- const metadata = Reflect . getOwnMetadata ( metadataKey , from , propertyKey )
29- Reflect . defineMetadata ( metadataKey , metadata , to , propertyKey )
30+ if ( propertyKey == 'constructor' ) {
31+ const metadata = Reflect . getOwnMetadata ( metadataKey , from )
32+ Reflect . defineMetadata ( metadataKey , metadata , to )
33+ } else {
34+ const metadata = Reflect . getOwnMetadata ( metadataKey , from , propertyKey )
35+ Reflect . defineMetadata ( metadataKey , metadata , to , propertyKey )
36+ }
3037 } )
3138 }
3239}
0 commit comments