@@ -97,6 +97,32 @@ describe('decorators', function(){
97
97
} ) ;
98
98
99
99
describe ( 'prototype methods' , function ( ) {
100
+ it ( 'should support numeric props' , function ( ) {
101
+ function dec ( target , name , descriptor ) {
102
+ expect ( name ) . to . eql ( 4 ) ;
103
+ }
104
+
105
+ class Example {
106
+ @dec
107
+ 4 ( ) {
108
+
109
+ }
110
+ }
111
+ } ) ;
112
+
113
+ it ( 'should support string props' , function ( ) {
114
+ function dec ( target , name , descriptor ) {
115
+ expect ( name ) . to . eql ( "str" ) ;
116
+ }
117
+
118
+ class Example {
119
+ @dec
120
+ "str" ( ) {
121
+
122
+ }
123
+ }
124
+ } ) ;
125
+
100
126
it ( 'should allow returning a descriptor' , function ( ) {
101
127
function dec ( target , name , descriptor ) {
102
128
let value = descriptor . value ;
@@ -295,6 +321,32 @@ describe('decorators', function(){
295
321
} ) ;
296
322
297
323
describe ( 'static methods' , function ( ) {
324
+ it ( 'should support numeric props' , function ( ) {
325
+ function dec ( target , name , descriptor ) {
326
+ expect ( name ) . to . eql ( 4 ) ;
327
+ }
328
+
329
+ class Example {
330
+ @dec
331
+ static 4 ( ) {
332
+
333
+ }
334
+ }
335
+ } ) ;
336
+
337
+ it ( 'should support string props' , function ( ) {
338
+ function dec ( target , name , descriptor ) {
339
+ expect ( name ) . to . eql ( "str" ) ;
340
+ }
341
+
342
+ class Example {
343
+ @dec
344
+ static "str" ( ) {
345
+
346
+ }
347
+ }
348
+ } ) ;
349
+
298
350
it ( 'should allow returning a descriptor' , function ( ) {
299
351
function dec ( target , name , descriptor ) {
300
352
let value = descriptor . value ;
@@ -722,6 +774,32 @@ describe('decorators', function(){
722
774
} ) ;
723
775
724
776
describe ( 'methods' , function ( ) {
777
+ it ( 'should support numeric props' , function ( ) {
778
+ function dec ( target , name , descriptor ) {
779
+ expect ( name ) . to . eql ( 4 ) ;
780
+ }
781
+
782
+ const inst = {
783
+ @dec
784
+ 4 ( ) {
785
+
786
+ }
787
+ } ;
788
+ } ) ;
789
+
790
+ it ( 'should support string props' , function ( ) {
791
+ function dec ( target , name , descriptor ) {
792
+ expect ( name ) . to . eql ( "str" ) ;
793
+ }
794
+
795
+ const inst = {
796
+ @dec
797
+ "str" ( ) {
798
+
799
+ }
800
+ } ;
801
+ } ) ;
802
+
725
803
it ( 'should allow returning a descriptor' , function ( ) {
726
804
function dec ( target , name , descriptor ) {
727
805
let value = descriptor . value ;
@@ -918,6 +996,28 @@ describe('decorators', function(){
918
996
} ) ;
919
997
920
998
describe ( 'properties' , function ( ) {
999
+ it ( 'should support numeric props' , function ( ) {
1000
+ function dec ( target , name , descriptor ) {
1001
+ expect ( name ) . to . eql ( 4 ) ;
1002
+ }
1003
+
1004
+ const inst = {
1005
+ @dec
1006
+ 4 : 1
1007
+ } ;
1008
+ } ) ;
1009
+
1010
+ it ( 'should support string props' , function ( ) {
1011
+ function dec ( target , name , descriptor ) {
1012
+ expect ( name ) . to . eql ( "str" ) ;
1013
+ }
1014
+
1015
+ const inst = {
1016
+ @dec
1017
+ "str" : 1
1018
+ } ;
1019
+ } ) ;
1020
+
921
1021
it ( 'should allow returning a descriptor' , function ( ) {
922
1022
function dec ( target , name , descriptor ) {
923
1023
let initializer = descriptor . initializer ;
0 commit comments