File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ export type ReflectionMap = {
1010 static : StringToArrayMap
1111}
1212
13- export function reflectionIsSupported ( ) {
13+ export function reflectionIsSupported ( ) {
1414 return ( Reflect && Reflect . defineMetadata ) !== undefined
1515}
1616
17- export function copyReflectionMetadata (
17+ export function copyReflectionMetadata (
1818 from : VueConstructor ,
1919 to : VueConstructor ,
2020 reflectionMap : ReflectionMap
@@ -24,7 +24,7 @@ export function copyReflectionMetadata(
2424 shallowCopy ( from , to , { 'constructor' : reflectionMap . constructor } )
2525}
2626
27- function shallowCopy ( from : VueConstructor , to : VueConstructor , propertyKeys : StringToArrayMap ) {
27+ function shallowCopy ( from : VueConstructor , to : VueConstructor , propertyKeys : StringToArrayMap ) {
2828 for ( const propertyKey in propertyKeys ) {
2929 propertyKeys [ propertyKey ] . forEach ( ( metadataKey ) => {
3030 if ( propertyKey == 'constructor' ) {
Original file line number Diff line number Diff line change @@ -372,23 +372,27 @@ describe('vue-class-component', () => {
372372 } )
373373
374374 it ( 'copies reflection metadata' , function ( ) {
375- const trickyDecorator = ( proto : Vue , _ : string ) =>
376- Reflect . defineMetadata ( 'worksConstructor' , true , proto . constructor )
377-
378375 @Component
376+ @Reflect . metadata ( 'worksConstructor' , true )
379377 class Test extends Vue {
380- @trickyDecorator
381- trickyCase : string = 'trickyCase'
382-
383378 @Reflect . metadata ( 'worksStatic' , true )
384379 static staticValue : string = 'staticValue'
385380
381+ private _test : boolean = false ;
382+
386383 @Reflect . metadata ( 'worksMethod' , true )
387- test ( ) : void { }
384+ test ( ) : void {
385+ void 0
386+ }
388387
389388 @Reflect . metadata ( 'worksAccessor' , true )
390- get testAccessor ( ) : boolean { return true }
391- set testAccessor ( value : boolean ) { void ( value ) }
389+ get testAccessor ( ) : boolean {
390+ return this . _test
391+ }
392+
393+ set testAccessor ( value : boolean ) {
394+ this . _test = value
395+ }
392396 }
393397
394398 expect ( Reflect . getOwnMetadata ( 'worksConstructor' , Test ) ) . to . equal ( true )
You can’t perform that action at this time.
0 commit comments