@@ -45,6 +45,10 @@ new RuleTester({
45
45
'ReflectDefineProperty({}, "key", { "__proto__": null })' ,
46
46
'ObjectDefineProperty({}, "key", { \'__proto__\': null })' ,
47
47
'ReflectDefineProperty({}, "key", { \'__proto__\': null })' ,
48
+ 'new Proxy({}, otherObject)' ,
49
+ 'new Proxy({}, someFactory())' ,
50
+ 'new Proxy({}, { __proto__: null })' ,
51
+ 'new Proxy({}, { __proto__: null, ...{} })' ,
48
52
] ,
49
53
invalid : [
50
54
{
@@ -183,5 +187,21 @@ new RuleTester({
183
187
code : 'StringPrototypeSplit("some string", /some regex/)' ,
184
188
errors : [ { message : / l o o k s u p t h e S y m b o l \. s p l i t p r o p e r t y / } ] ,
185
189
} ,
190
+ {
191
+ code : 'new Proxy({}, {})' ,
192
+ errors : [ { message : / n u l l - p r o t o t y p e / } ]
193
+ } ,
194
+ {
195
+ code : 'new Proxy({}, { [`__proto__`]: null })' ,
196
+ errors : [ { message : / n u l l - p r o t o t y p e / } ]
197
+ } ,
198
+ {
199
+ code : 'new Proxy({}, { __proto__: Object.prototype })' ,
200
+ errors : [ { message : / n u l l - p r o t o t y p e / } ]
201
+ } ,
202
+ {
203
+ code : 'new Proxy({}, { ...{ __proto__: null } })' ,
204
+ errors : [ { message : / n u l l - p r o t o t y p e / } ]
205
+ } ,
186
206
]
187
207
} ) ;
0 commit comments