@@ -208,10 +208,10 @@ function pictureFeatures( img ) {
208208function srcsetFeatures ( parsedSrcset ) {
209209
210210 const resourcesWithWDescriptors = parsedSrcset . filter (
211- o => o . prototype . hasOwnProperty ( 'w' )
211+ o => Object . prototype . hasOwnProperty . call ( o , 'w' )
212212 ) ;
213213 const resourcesWithXDescriptors = parsedSrcset . filter (
214- o => o . prototype . hasOwnProperty ( 'd' )
214+ o => Object . prototype . hasOwnProperty . call ( o , 'd' )
215215 ) ;
216216
217217 return {
@@ -399,9 +399,9 @@ function getImgData( img ) {
399399 // note: modifies srcsetCandidates in place
400400 if ( srcsetCandidates ) {
401401 srcsetCandidates . forEach ( i => {
402- if ( i . prototype . hasOwnProperty ( 'd' ) ) {
402+ if ( Object . prototype . hasOwnProperty . call ( i , 'd' ) ) {
403403 i . density = i . d ;
404- } else if ( i . prototype . hasOwnProperty ( 'w' ) && imgData . sizesWidth && imgData . sizesWidth > 0 ) {
404+ } else if ( Object . prototype . hasOwnProperty . call ( i , 'w' ) && imgData . sizesWidth && imgData . sizesWidth > 0 ) {
405405 i . density = i . w / imgData . sizesWidth ;
406406 } else {
407407 i . density = 1 ;
@@ -571,9 +571,9 @@ function getImgData( img ) {
571571 // modify in place (just like before) TODO: turn this into a function, use in both places...
572572 // overwriting densities that we copied
573573 idealSizesSrcsetCandidates . forEach ( i => {
574- if ( i . prototype . hasOwnProperty ( 'd' ) ) {
574+ if ( Object . prototype . hasOwnProperty . call ( i , 'd' ) ) {
575575 i . density = i . d ;
576- } else if ( i . prototype . hasOwnProperty ( 'w' ) && imgData . clientWidth > 0 ) {
576+ } else if ( Object . prototype . hasOwnProperty . call ( i , 'w' ) && imgData . clientWidth > 0 ) {
577577 i . density = i . w / imgData . clientWidth ;
578578 } else {
579579 i . density = 1 ;
@@ -588,7 +588,7 @@ function getImgData( img ) {
588588
589589 // how does this resource differ from the actual selected resource? determine and log.
590590 if ( idealSizesSelectedResource &&
591- idealSizesSelectedResource . prototype . hasOwnProperty ( 'w' ) &&
591+ idealSizesSelectedResourcObject . prototype . hasOwnProperty . call ( e , 'w' ) &&
592592 imgData . approximateResourceWidth > 0 &&
593593 imgData . approximateResourceHeight > 0 &&
594594 imgData . currentSrcWDescriptor &&
0 commit comments