@@ -45,6 +45,10 @@ new RuleTester({
4545 'ReflectDefineProperty({}, "key", { "__proto__": null })' ,
4646 'ObjectDefineProperty({}, "key", { \'__proto__\': null })' ,
4747 'ReflectDefineProperty({}, "key", { \'__proto__\': null })' ,
48+ 'new Proxy({}, otherObject)' ,
49+ 'new Proxy({}, someFactory())' ,
50+ 'new Proxy({}, { __proto__: null })' ,
51+ 'new Proxy({}, { __proto__: null, ...{} })' ,
4852 ] ,
4953 invalid : [
5054 {
@@ -183,5 +187,21 @@ new RuleTester({
183187 code : 'StringPrototypeSplit("some string", /some regex/)' ,
184188 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 / } ] ,
185189 } ,
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+ } ,
186206 ]
187207 } ) ;
0 commit comments