@@ -125,6 +125,8 @@ describe('decorators', function(){
125
125
126
126
it ( 'should allow returning a descriptor' , function ( ) {
127
127
function dec ( target , name , descriptor ) {
128
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
129
+
128
130
let value = descriptor . value ;
129
131
return {
130
132
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -177,6 +179,19 @@ describe('decorators', function(){
177
179
return 8 ;
178
180
}
179
181
}
182
+
183
+ expect ( Example . prototype ) . to . have . ownProperty ( 'decoratedProps' ) ;
184
+ expect ( Example . prototype . decoratedProps ) . to . eql ( [
185
+ "enumconfwrite" ,
186
+ "enumconf" ,
187
+ "enumwrite" ,
188
+ "enum" ,
189
+ "confwrite" ,
190
+ "conf" ,
191
+ "write" ,
192
+ "_" ,
193
+ ] ) ;
194
+
180
195
const inst = new Example ( ) ;
181
196
182
197
const descs = Object . getOwnPropertyDescriptors ( Example . prototype ) ;
@@ -223,6 +238,8 @@ describe('decorators', function(){
223
238
224
239
it ( 'should allow mutating the original descriptor' , function ( ) {
225
240
function dec ( target , name , descriptor ) {
241
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
242
+
226
243
let value = descriptor . value ;
227
244
Object . assign ( descriptor , {
228
245
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -275,6 +292,19 @@ describe('decorators', function(){
275
292
return 8 ;
276
293
}
277
294
}
295
+
296
+ expect ( Example . prototype ) . to . have . ownProperty ( 'decoratedProps' ) ;
297
+ expect ( Example . prototype . decoratedProps ) . to . eql ( [
298
+ "enumconfwrite" ,
299
+ "enumconf" ,
300
+ "enumwrite" ,
301
+ "enum" ,
302
+ "confwrite" ,
303
+ "conf" ,
304
+ "write" ,
305
+ "_" ,
306
+ ] ) ;
307
+
278
308
const inst = new Example ( ) ;
279
309
280
310
const descs = Object . getOwnPropertyDescriptors ( Example . prototype ) ;
@@ -349,6 +379,8 @@ describe('decorators', function(){
349
379
350
380
it ( 'should allow returning a descriptor' , function ( ) {
351
381
function dec ( target , name , descriptor ) {
382
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
383
+
352
384
let value = descriptor . value ;
353
385
return {
354
386
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -402,6 +434,18 @@ describe('decorators', function(){
402
434
}
403
435
}
404
436
437
+ expect ( Example ) . to . have . ownProperty ( 'decoratedProps' ) ;
438
+ expect ( Example . decoratedProps ) . to . eql ( [
439
+ "enumconfwrite" ,
440
+ "enumconf" ,
441
+ "enumwrite" ,
442
+ "enum" ,
443
+ "confwrite" ,
444
+ "conf" ,
445
+ "write" ,
446
+ "_" ,
447
+ ] ) ;
448
+
405
449
const descs = Object . getOwnPropertyDescriptors ( Example ) ;
406
450
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
407
451
expect ( descs . enumconfwrite . writable ) . to . be . true ;
@@ -446,6 +490,8 @@ describe('decorators', function(){
446
490
447
491
it ( 'should allow mutating the original descriptor' , function ( ) {
448
492
function dec ( target , name , descriptor ) {
493
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
494
+
449
495
let value = descriptor . value ;
450
496
Object . assign ( descriptor , {
451
497
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -499,6 +545,18 @@ describe('decorators', function(){
499
545
}
500
546
}
501
547
548
+ expect ( Example ) . to . have . ownProperty ( 'decoratedProps' ) ;
549
+ expect ( Example . decoratedProps ) . to . eql ( [
550
+ "enumconfwrite" ,
551
+ "enumconf" ,
552
+ "enumwrite" ,
553
+ "enum" ,
554
+ "confwrite" ,
555
+ "conf" ,
556
+ "write" ,
557
+ "_" ,
558
+ ] ) ;
559
+
502
560
const descs = Object . getOwnPropertyDescriptors ( Example ) ;
503
561
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
504
562
expect ( descs . enumconfwrite . writable ) . to . be . true ;
@@ -559,6 +617,8 @@ describe('decorators', function(){
559
617
560
618
it ( 'should allow returning a descriptor' , function ( ) {
561
619
function dec ( target , name , descriptor ) {
620
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
621
+
562
622
let initializer = descriptor . initializer ;
563
623
return {
564
624
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -597,6 +657,18 @@ describe('decorators', function(){
597
657
}
598
658
const inst = new Example ( ) ;
599
659
660
+ expect ( Example . prototype ) . to . have . ownProperty ( 'decoratedProps' ) ;
661
+ expect ( inst . decoratedProps ) . to . eql ( [
662
+ "enumconfwrite" ,
663
+ "enumconf" ,
664
+ "enumwrite" ,
665
+ "enum" ,
666
+ "confwrite" ,
667
+ "conf" ,
668
+ "write" ,
669
+ "_" ,
670
+ ] ) ;
671
+
600
672
const descs = Object . getOwnPropertyDescriptors ( inst ) ;
601
673
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
602
674
expect ( descs . enumconfwrite . writable ) . to . be . true ;
@@ -643,6 +715,8 @@ describe('decorators', function(){
643
715
644
716
it ( 'should allow mutating the original descriptor' , function ( ) {
645
717
function dec ( target , name , descriptor ) {
718
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
719
+
646
720
let initializer = descriptor . initializer ;
647
721
Object . assign ( descriptor , {
648
722
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -681,6 +755,18 @@ describe('decorators', function(){
681
755
}
682
756
const inst = new Example ( ) ;
683
757
758
+ expect ( Example . prototype ) . to . have . ownProperty ( 'decoratedProps' ) ;
759
+ expect ( inst . decoratedProps ) . to . eql ( [
760
+ "enumconfwrite" ,
761
+ "enumconf" ,
762
+ "enumwrite" ,
763
+ "enum" ,
764
+ "confwrite" ,
765
+ "conf" ,
766
+ "write" ,
767
+ "_" ,
768
+ ] ) ;
769
+
684
770
const descs = Object . getOwnPropertyDescriptors ( inst ) ;
685
771
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
686
772
expect ( descs . enumconfwrite . writable ) . to . be . true ;
@@ -816,6 +902,8 @@ describe('decorators', function(){
816
902
817
903
it ( 'should allow returning a descriptor' , function ( ) {
818
904
function dec ( target , name , descriptor ) {
905
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
906
+
819
907
let value = descriptor . value ;
820
908
return {
821
909
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -869,6 +957,18 @@ describe('decorators', function(){
869
957
} ,
870
958
}
871
959
960
+ expect ( inst ) . to . have . ownProperty ( 'decoratedProps' ) ;
961
+ expect ( inst . decoratedProps ) . to . eql ( [
962
+ "enumconfwrite" ,
963
+ "enumconf" ,
964
+ "enumwrite" ,
965
+ "enum" ,
966
+ "confwrite" ,
967
+ "conf" ,
968
+ "write" ,
969
+ "_" ,
970
+ ] ) ;
971
+
872
972
const descs = Object . getOwnPropertyDescriptors ( inst ) ;
873
973
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
874
974
expect ( descs . enumconfwrite . writable ) . to . be . true ;
@@ -913,6 +1013,8 @@ describe('decorators', function(){
913
1013
914
1014
it ( 'should allow mutating the original descriptor' , function ( ) {
915
1015
function dec ( target , name , descriptor ) {
1016
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
1017
+
916
1018
let value = descriptor . value ;
917
1019
Object . assign ( descriptor , {
918
1020
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -966,6 +1068,18 @@ describe('decorators', function(){
966
1068
} ,
967
1069
}
968
1070
1071
+ expect ( inst ) . to . have . ownProperty ( 'decoratedProps' ) ;
1072
+ expect ( inst . decoratedProps ) . to . eql ( [
1073
+ "enumconfwrite" ,
1074
+ "enumconf" ,
1075
+ "enumwrite" ,
1076
+ "enum" ,
1077
+ "confwrite" ,
1078
+ "conf" ,
1079
+ "write" ,
1080
+ "_" ,
1081
+ ] ) ;
1082
+
969
1083
const descs = Object . getOwnPropertyDescriptors ( inst ) ;
970
1084
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
971
1085
expect ( descs . enumconfwrite . writable ) . to . be . true ;
@@ -1034,6 +1148,8 @@ describe('decorators', function(){
1034
1148
1035
1149
it ( 'should allow returning a descriptor' , function ( ) {
1036
1150
function dec ( target , name , descriptor ) {
1151
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
1152
+
1037
1153
let initializer = descriptor . initializer ;
1038
1154
return {
1039
1155
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -1071,6 +1187,18 @@ describe('decorators', function(){
1071
1187
_ : 8 ,
1072
1188
} ;
1073
1189
1190
+ expect ( inst ) . to . have . ownProperty ( 'decoratedProps' ) ;
1191
+ expect ( inst . decoratedProps ) . to . eql ( [
1192
+ "enumconfwrite" ,
1193
+ "enumconf" ,
1194
+ "enumwrite" ,
1195
+ "enum" ,
1196
+ "confwrite" ,
1197
+ "conf" ,
1198
+ "write" ,
1199
+ "_" ,
1200
+ ] ) ;
1201
+
1074
1202
const descs = Object . getOwnPropertyDescriptors ( inst ) ;
1075
1203
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
1076
1204
expect ( descs . enumconfwrite . writable ) . to . be . true ;
@@ -1115,6 +1243,8 @@ describe('decorators', function(){
1115
1243
1116
1244
it ( 'should allow mutating the original descriptor' , function ( ) {
1117
1245
function dec ( target , name , descriptor ) {
1246
+ target . decoratedProps = ( target . decoratedProps || [ ] ) . concat ( [ name ] ) ;
1247
+
1118
1248
let initializer = descriptor . initializer ;
1119
1249
Object . assign ( descriptor , {
1120
1250
enumerable : name . indexOf ( 'enum' ) !== - 1 ,
@@ -1152,6 +1282,18 @@ describe('decorators', function(){
1152
1282
_ : 8 ,
1153
1283
} ;
1154
1284
1285
+ expect ( inst ) . to . have . ownProperty ( 'decoratedProps' ) ;
1286
+ expect ( inst . decoratedProps ) . to . eql ( [
1287
+ "enumconfwrite" ,
1288
+ "enumconf" ,
1289
+ "enumwrite" ,
1290
+ "enum" ,
1291
+ "confwrite" ,
1292
+ "conf" ,
1293
+ "write" ,
1294
+ "_" ,
1295
+ ] ) ;
1296
+
1155
1297
const descs = Object . getOwnPropertyDescriptors ( inst ) ;
1156
1298
expect ( descs . enumconfwrite . enumerable ) . to . be . true ;
1157
1299
expect ( descs . enumconfwrite . writable ) . to . be . true ;
0 commit comments