Skip to content

Commit 9eff4a3

Browse files
committed
Linting
1 parent 5ab0c26 commit 9eff4a3

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

dist/media.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
//[media]
22
// Uncomment the previous line for testing on webpagetest.org
33

4-
// Sanitize the `attributes` property.
5-
function getNodeAttributes(node) {
6-
// Inspired by dequelabs/axe-core.
7-
if (node.attributes instanceof NamedNodeMap) {
8-
return node.attributes;
9-
}
10-
return node.cloneNode(false).attributes;
11-
}
12-
134
return JSON.stringify({
145
// Counts the number of picture tags containing an img tag
156
'num_picture_img': document.querySelectorAll('picture img').length,

dist/responsive_images.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ function pictureFeatures( img ) {
208208
function 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 &&

dist/robots_meta.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ try {
9494
let robots_bodies = processRobotsHTML(doc);
9595

9696
for (let bot in robots_bodies) {
97-
if (!result_bodies.prototype.hasOwnProperty(bot)) {
97+
if (!result_bodieObject.prototype.hasOwnProperty.call(s, bot)) {
9898
result_bodies[bot] = Object.assign({}, base);
9999
}
100100
[...Object.entries(robots_bodies[bot])].forEach(item=>{
@@ -105,7 +105,7 @@ try {
105105
}
106106
let robots_headers = processRobotsHeaders(headers);
107107
for (let bot in robots_headers) {
108-
if (!result_headers.prototype.hasOwnProperty(bot)) {
108+
if (!result_headerObject.prototype.hasOwnProperty.call(s, bot)) {
109109
result_headers[bot] = Object.assign({}, base);
110110
}
111111
[...Object.entries(robots_headers[bot])].forEach(item=>{

0 commit comments

Comments
 (0)