},
"rules": {
"dot-notation": 0,
- "max-len": 0,
- "no-prototype-builtins": 0
+ "max-len": 0
}
}
// Build array of key names
for ( key in ts.collationTable ) {
// Check hasOwn to be safe
- if ( ts.collationTable.hasOwnProperty( key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( ts.collationTable, key ) ) {
keys.push( mw.RegExp.escape( key ) );
}
}
tiff: 'tif',
ogv: 'ogg'
};
- if ( squish.hasOwnProperty( lower ) ) {
+ if ( Object.prototype.hasOwnProperty.call( squish, lower ) ) {
return squish[ lower ];
} else if ( /^[0-9a-z]+$/.test( lower ) ) {
return lower;
// Copy data over from existing URI object
for ( prop in uri ) {
// Only copy direct properties, not inherited ones
- if ( uri.hasOwnProperty( prop ) ) {
+ if ( Object.prototype.hasOwnProperty.call( uri, prop ) ) {
// Deep copy object properties
if ( Array.isArray( uri[ prop ] ) || $.isPlainObject( uri[ prop ] ) ) {
this[ prop ] = $.extend( true, {}, uri[ prop ] );
function getFirstKey( obj ) {
var key;
for ( key in obj ) {
- if ( obj.hasOwnProperty( key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( obj, key ) ) {
return key;
}
}
};
for ( id in panes ) {
- if ( !panes.hasOwnProperty( id ) ) {
+ if ( !Object.prototype.hasOwnProperty.call( panes, id ) ) {
continue;
}
.appendTo( $table );
for ( key in data ) {
- if ( !data.hasOwnProperty( key ) ) {
+ if ( !Object.prototype.hasOwnProperty.call( data, key ) ) {
continue;
}
getAst: function ( key ) {
var wikiText;
- if ( !this.astCache.hasOwnProperty( key ) ) {
+ if ( !Object.prototype.hasOwnProperty.call( this.astCache, key ) ) {
wikiText = this.settings.messages.get( key );
if ( typeof wikiText !== 'string' ) {
wikiText = '⧼' + key + '⧽';
return oldParser.apply( this );
}
- if ( !this.map.hasOwnProperty( this.format ) ) {
+ if ( !Object.prototype.hasOwnProperty.call( this.map, this.format ) ) {
this.map[ this.format ] = mw.jqueryMsg.getMessageFunction( {
messages: this.map,
// For format 'escaped', escaping part is handled by mediawiki.js
for ( i = 0; i < arguments.length; i++ ) {
table = arguments[ i ];
for ( key in table ) {
- if ( table.hasOwnProperty( key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( table, key ) ) {
// The thousand separator should be deleted
flipped[ table[ key ] ] = key === ',' ? '' : key;
}
if ( transformTable ) {
convertedNumber = '';
for ( i = 0; i < numberString.length; i++ ) {
- if ( transformTable.hasOwnProperty( numberString[ i ] ) ) {
+ if ( Object.prototype.hasOwnProperty.call( transformTable, numberString[ i ] ) ) {
convertedNumber += transformTable[ numberString[ i ] ];
} else {
convertedNumber += numberString[ i ];
actionPaths = mw.config.get( 'wgActionPaths' );
for ( key in actionPaths ) {
- if ( actionPaths.hasOwnProperty( key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( actionPaths, key ) ) {
parts = actionPaths[ key ].split( '$1' );
parts = parts.map( mw.RegExp.escape );
m = new RegExp( parts.join( '(.+)' ) ).exec( url );
var apiPromise,
deferred = $.Deferred();
- if ( moduleInfoCache.hasOwnProperty( module ) ) {
+ if ( Object.prototype.hasOwnProperty.call( moduleInfoCache, module ) ) {
return deferred
.resolve( moduleInfoCache[ module ] )
.promise( { abort: function () {} } );
subpages = page.getSubpages();
for ( i = 0; i < subpages.length; i++ ) {
- if ( pages.hasOwnProperty( subpages[ i ].key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( pages, subpages[ i ].key ) ) {
checkPages.push( pages[ subpages[ i ].key ] );
}
}
if ( page.getSubpages ) {
subpages = page.getSubpages();
for ( j = 0; j < subpages.length; j++ ) {
- if ( !pages.hasOwnProperty( subpages[ j ].key ) ) {
+ if ( !Object.prototype.hasOwnProperty.call( pages, subpages[ j ].key ) ) {
subpages[ j ].indentLevel = page.indentLevel + 1;
pages[ subpages[ j ].key ] = new ApiSandbox.PageLayout( subpages[ j ] );
}
page.getQueryParams( params, displayParams );
subpages = page.getSubpages();
for ( i = 0; i < subpages.length; i++ ) {
- if ( pages.hasOwnProperty( subpages[ i ].key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( pages, subpages[ i ].key ) ) {
checkPages.push( pages[ subpages[ i ].key ] );
}
}
// Force a 'fm' format with wrappedhtml=1, if available
if ( params.format !== undefined ) {
- if ( availableFormats.hasOwnProperty( params.format + 'fm' ) ) {
+ if ( Object.prototype.hasOwnProperty.call( availableFormats, params.format + 'fm' ) ) {
params.format = params.format + 'fm';
}
if ( params.format.substr( -2 ) === 'fm' ) {
subpages = page.getSubpages();
for ( i = 0; i < subpages.length; i++ ) {
- if ( pages.hasOwnProperty( subpages[ i ].key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( pages, subpages[ i ].key ) ) {
checkPages.push( pages[ subpages[ i ].key ] );
}
}
page.apiCheckValid();
subpages = page.getSubpages();
for ( i = 0; i < subpages.length; i++ ) {
- if ( pages.hasOwnProperty( subpages[ i ].key ) ) {
+ if ( Object.prototype.hasOwnProperty.call( pages, subpages[ i ].key ) ) {
checkPages.push( pages[ subpages[ i ].key ] );
}
}
}
}
if ( params ) {
- tmp.widget.setApiValue( params.hasOwnProperty( name ) ? params[ name ] : undefined );
+ tmp.widget.setApiValue( Object.prototype.hasOwnProperty.call( params, name ) ? params[ name ] : undefined );
}
} else {
newVars = {};
buttons = [],
filterFmModules = function ( v ) {
return v.substr( -2 ) !== 'fm' ||
- !availableFormats.hasOwnProperty( v.substr( 0, v.length - 2 ) );
+ !Object.prototype.hasOwnProperty.call( availableFormats, v.substr( 0, v.length - 2 ) );
};
// This is something of a hack. We always want the 'format' and
this.loadFromQueryParams = params;
} else {
$.each( this.widgets, function ( name, widget ) {
- var v = params.hasOwnProperty( name ) ? params[ name ] : undefined;
+ var v = Object.prototype.hasOwnProperty.call( params, name ) ? params[ name ] : undefined;
widget.setApiValue( v );
} );
this.updateTemplatedParameters( params );
clearTimeout( this.timeoutID );
}
// Check response cache
- if ( this.responseCache.hasOwnProperty( this.nameToCheck ) ) {
+ if ( Object.prototype.hasOwnProperty.call( this.responseCache, this.nameToCheck ) ) {
this.setWarning( this.responseCache[ this.nameToCheck ] );
return;
}
var template = $element.val(),
$spinner;
- if ( this.responseCache.hasOwnProperty( template ) ) {
+ if ( Object.prototype.hasOwnProperty.call( this.responseCache, template ) ) {
this.showPreview( this.responseCache[ template ], $previewContainer );
return;
}
* corresponding call to set().
*/
clear: function ( visibleTimeoutId ) {
- if ( activeTimeouts.hasOwnProperty( visibleTimeoutId ) ) {
+ if ( Object.prototype.hasOwnProperty.call( activeTimeouts, visibleTimeoutId ) ) {
activeTimeouts[ visibleTimeoutId ]();
}
}
var api = this.getApi(),
cache = this.constructor.static.interwikiPrefixesPromiseCache,
key = api.defaults.ajax.url;
- if ( !cache.hasOwnProperty( key ) ) {
+ if ( !Object.prototype.hasOwnProperty.call( cache, key ) ) {
cache[ key ] = api.get( {
action: 'query',
meta: 'siteinfo',