resourceloader: Remove redundant closure of some startup and base files
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 24 Sep 2019 00:09:04 +0000 (01:09 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 24 Sep 2019 00:09:04 +0000 (01:09 +0100)
commitf4975bc6de776c8eb06490932329a3c8d657eabd
tree36451dc70a5587407062510ede1ef8556ef3fee9
parent9e8439e79d67788916d488f645108f79016d9aca
resourceloader: Remove redundant closure of some startup and base files

* errorLogger: Contains only top-level assignments and statements,
  no scope needed. If it does need a scope at some point, then it
  should be converted to packageFiles first so that the closure
  still isn't needed (see T50886).

* requestIdleCallback: This file should do nothing in modern browsers,
  except alias a native method, and expose the fallback for testing.
  Remove the closure and with it the (usually) unused local var.

* mediawiki.js: Use the shorter Object.hasOwnProperty instead,
  we already do this in several files. Both provide a quick reference
  to the native method. Object.prototype.hasOwnProperty is more direct
  visually, but also less direct at run-time (3 lookups instead of 2).
  MW does not support environments that extend native classes such as
  Object or their prototypes, so this makes no difference in that
  regard and is already done in several core files. (More wide changes
  to be done separately).

Change-Id: I98ed4da4807c54254669053cef47a3e67b4ad2cf
resources/src/mediawiki.base/mediawiki.errorLogger.js
resources/src/startup/mediawiki.js
resources/src/startup/mediawiki.requestIdleCallback.js