mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-30 18:34:40 +00:00
eslint: Enforce no-prototype-builtins
Change-Id: I4244f0576e48c233d24533b45a28c07b2531d6da
This commit is contained in:
parent
2687d12c52
commit
cfa0b100ad
|
@ -18,7 +18,6 @@
|
|||
"OO": "readonly"
|
||||
},
|
||||
"rules": {
|
||||
"no-prototype-builtins": "off",
|
||||
"no-use-before-define": "off",
|
||||
"template-curly-spacing": "off"
|
||||
}
|
||||
|
|
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map.json
vendored
BIN
resources/dist/index.js.map.json
vendored
Binary file not shown.
|
@ -41,7 +41,7 @@ export default function createContainer() {
|
|||
* `false`
|
||||
*/
|
||||
has( name ) {
|
||||
return factories.hasOwnProperty( name );
|
||||
return Object.prototype.hasOwnProperty.call( factories, name );
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -82,7 +82,7 @@ export default function createContainer() {
|
|||
return factory;
|
||||
}
|
||||
|
||||
if ( !cache.hasOwnProperty( name ) ) {
|
||||
if ( !Object.prototype.hasOwnProperty.call( cache, name ) ) {
|
||||
cache[ name ] = factories[ name ]( this );
|
||||
}
|
||||
|
||||
|
|
|
@ -20,15 +20,16 @@
|
|||
*/
|
||||
export default function nextState( state, updates ) {
|
||||
const result = {};
|
||||
const hasOwn = Object.prototype.hasOwnProperty;
|
||||
|
||||
for ( const key in state ) {
|
||||
if ( state.hasOwnProperty( key ) && !updates.hasOwnProperty( key ) ) {
|
||||
if ( hasOwn.call( state, key ) && !hasOwn.call( updates, key ) ) {
|
||||
result[ key ] = state[ key ];
|
||||
}
|
||||
}
|
||||
|
||||
for ( const key in updates ) {
|
||||
if ( updates.hasOwnProperty( key ) ) {
|
||||
if ( hasOwn.call( updates, key ) ) {
|
||||
result[ key ] = updates[ key ];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ export function getTitle( href, config ) {
|
|||
} catch ( e ) {
|
||||
// Will return undefined below
|
||||
}
|
||||
} else if ( queryLength === 1 && linkHref.query.hasOwnProperty( 'title' ) ) {
|
||||
} else if ( queryLength === 1 && 'title' in linkHref.query ) {
|
||||
// URL is not pretty, but only has a `title` parameter
|
||||
title = linkHref.query.title;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue