@@ -70,6 +70,14 @@ ruleTester.run("no-self-assign", rule, {
70
70
{
71
71
code : "a[\n 'b'\n] = a[\n 'b'\n]" ,
72
72
options : [ { props : false } ]
73
+ } ,
74
+ {
75
+ code : "this.x = this.y" ,
76
+ options : [ { props : true } ]
77
+ } ,
78
+ {
79
+ code : "this.x = this.x" ,
80
+ options : [ { props : false } ]
73
81
}
74
82
] ,
75
83
invalid : [
@@ -120,6 +128,11 @@ ruleTester.run("no-self-assign", rule, {
120
128
{ code : "a.b.c = a.b.c" , options : [ { props : true } ] , errors : [ "'a.b.c' is assigned to itself." ] } ,
121
129
{ code : "a[b] = a[b]" , options : [ { props : true } ] , errors : [ "'a[b]' is assigned to itself." ] } ,
122
130
{ code : "a['b'] = a['b']" , options : [ { props : true } ] , errors : [ "'a['b']' is assigned to itself." ] } ,
123
- { code : "a[\n 'b'\n] = a[\n 'b'\n]" , options : [ { props : true } ] , errors : [ "'a['b']' is assigned to itself." ] }
131
+ { code : "a[\n 'b'\n] = a[\n 'b'\n]" , options : [ { props : true } ] , errors : [ "'a['b']' is assigned to itself." ] } ,
132
+ {
133
+ code : "this.x = this.x" ,
134
+ options : [ { props : true } ] ,
135
+ errors : [ "'this.x' is assigned to itself." ]
136
+ }
124
137
]
125
138
} ) ;
0 commit comments