44 * @license MIT
55 */
66( function ( global , factory ) {
7- typeof exports === 'object' && typeof module !== 'undefined' ? factory ( exports , require ( 'reflect-metadata' ) , require ( ' vue') ) :
8- typeof define === 'function' && define . amd ? define ( [ 'exports' , 'reflect-metadata' , ' vue'] , factory ) :
9- ( factory ( ( global . VueClassComponent = { } ) , null , global . Vue ) ) ;
10- } ( this , ( function ( exports , reflectMetadata , Vue ) { 'use strict' ;
7+ typeof exports === 'object' && typeof module !== 'undefined' ? factory ( exports , require ( 'vue' ) ) :
8+ typeof define === 'function' && define . amd ? define ( [ 'exports' , 'vue' ] , factory ) :
9+ ( factory ( ( global . VueClassComponent = { } ) , global . Vue ) ) ;
10+ } ( this , ( function ( exports , Vue ) { 'use strict' ;
1111
1212Vue = Vue && Vue . hasOwnProperty ( 'default' ) ? Vue [ 'default' ] : Vue ;
1313
14- function copyReflectionMetadata ( from , to , reflectionMap ) {
15- shallowCopy ( from . prototype , to . prototype , reflectionMap . instance ) ;
16- shallowCopy ( from , to , reflectionMap . static ) ;
17- }
18- function shallowCopy ( from , to , propertyKeys ) {
19- var _loop_1 = function ( propertyKey ) {
20- propertyKeys [ propertyKey ] . forEach ( function ( metadataKey ) {
21- var metadata = Reflect . getOwnMetadata ( metadataKey , from , propertyKey ) ;
22- Reflect . defineMetadata ( metadataKey , metadata , to , propertyKey ) ;
23- } ) ;
24- } ;
25- for ( var propertyKey in propertyKeys ) {
26- _loop_1 ( propertyKey ) ;
27- }
28- }
29-
3014var hasProto = { __proto__ : [ ] } instanceof Array ;
3115function createDecorator ( factory ) {
3216 return function ( target , key , index ) {
@@ -121,18 +105,13 @@ var $internalHooks = [
121105] ;
122106function componentFactory ( Component , options ) {
123107 if ( options === void 0 ) { options = { } ; }
124- var reflectionMap = {
125- instance : { } ,
126- static : { }
127- } ;
128108 options . name = options . name || Component . _componentTag || Component . name ;
129109 // prototype props.
130110 var proto = Component . prototype ;
131111 Object . getOwnPropertyNames ( proto ) . forEach ( function ( key ) {
132112 if ( key === 'constructor' ) {
133113 return ;
134114 }
135- reflectionMap . instance [ key ] = Reflect . getOwnMetadataKeys ( proto , key ) ;
136115 // hooks
137116 if ( $internalHooks . indexOf ( key ) > - 1 ) {
138117 options [ key ] = proto [ key ] ;
@@ -168,8 +147,7 @@ function componentFactory(Component, options) {
168147 ? superProto . constructor
169148 : Vue ;
170149 var Extended = Super . extend ( options ) ;
171- forwardStaticMembersAndCollectReflection ( Extended , Component , Super , reflectionMap ) ;
172- copyReflectionMetadata ( Component , Extended , reflectionMap ) ;
150+ forwardStaticMembers ( Extended , Component , Super ) ;
173151 return Extended ;
174152}
175153var reservedPropertyNames = [
@@ -187,14 +165,13 @@ var reservedPropertyNames = [
187165 'directive' ,
188166 'filter'
189167] ;
190- function forwardStaticMembersAndCollectReflection ( Extended , Original , Super , reflectionMap ) {
168+ function forwardStaticMembers ( Extended , Original , Super ) {
191169 // We have to use getOwnPropertyNames since Babel registers methods as non-enumerable
192170 Object . getOwnPropertyNames ( Original ) . forEach ( function ( key ) {
193171 // `prototype` should not be overwritten
194172 if ( key === 'prototype' ) {
195173 return ;
196174 }
197- reflectionMap . static [ key ] = Reflect . getOwnMetadataKeys ( Original , key ) ;
198175 // Some browsers does not allow reconfigure built-in properties
199176 var extendedDescriptor = Object . getOwnPropertyDescriptor ( Extended , key ) ;
200177 if ( extendedDescriptor && ! extendedDescriptor . configurable ) {
0 commit comments