mw.loader: Use Object.create() instead of $.extend() where possible
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 14 Sep 2017 17:41:36 +0000 (19:41 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 18 Sep 2017 17:29:21 +0000 (18:29 +0100)
commit8c5a6fffaf674dfaa6288c98ce88ebeff6d81d7e
tree1aab41e7b9de88537ac568b50b7212e62c66f1b7
parent83020dbf41b66efb1eecdd3b09250425695ca93a
mw.loader: Use Object.create() instead of $.extend() where possible

For cases where we want a variation of an object with some keys added
or changed, use native Object.create() to create a plain object that
inherits from the other object (without needing to loop and copy each
key/value separately).

This optimisation only works, of course, if the original object
by-reference does not change later.

Also remove hasOwn filter from sortQuery, because it must now consider
inherited keys as well. This filter was already obsolete given mw.loader
already has many unfiltered for-in loops in other places, and just in
general doesn't support environments that extend Object.prototype.

Change-Id: Ib405e32d4598dfb94629c2596ea0804d1c13e7c0
resources/src/mediawiki/mediawiki.js