-( function ( mw, document ) {
+( function () {
var hidden, visibilityChange,
nextVisibleTimeoutId = 0,
activeTimeouts = {},
+ document = window.document,
init = function ( overrideDoc ) {
if ( overrideDoc !== undefined ) {
document = overrideDoc;
* corresponding call to set().
*/
clear: function ( visibleTimeoutId ) {
- if ( activeTimeouts.hasOwnProperty( visibleTimeoutId ) ) {
+ if ( Object.prototype.hasOwnProperty.call( activeTimeouts, visibleTimeoutId ) ) {
activeTimeouts[ visibleTimeoutId ]();
}
}
module.exports.setDocument = init;
}
-}( mediaWiki, document ) );
+}() );