resourceloader: Deprecate mw.Map
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 17 Sep 2016 22:50:47 +0000 (15:50 -0700)
committerOri.livneh <ori@wikimedia.org>
Tue, 25 Oct 2016 14:14:58 +0000 (14:14 +0000)
commitdc0f9b3a3a75e80a0c5f09dd76b4df1fcc05080d
tree158746f9329dd9a400a10cab0381ea41ee596294
parent55b83097583e2ea63cfd161f95d5973d59af2b5d
resourceloader: Deprecate mw.Map

This has never been used outside mediawiki.js for things like mw.config,
and mw.messages.

The public API of those objects will remain, but the constructor will
no longer be supported in the future in order to allow these to be
backed by native Map in the future (with a minimal polyfill rather than
a complete one).

* Remove 'mw.Map(valuesObject)'. (follows-up 63f8d7b9e5).
  This is incompatible with native Map and isn't actually used anywhere.

* Deprecate mw.Map#values. Undocumented and considered private.
  A few uses have appeared in the wild so keep a short deprecation period.

* Update the MediaWiki QUnit runner to construct new maps in setup/teardown
  instead of swapping the internal values object directly.
  Also update the runner to update mediawiki.jqueryMsg's parser default since
  it kept a reference to the first mw.messages object.

* Add 'logName' parameter to mw.log.deprecate(). Default logName
  of property key made sense for its original use case (deprecation warnings
  for global variables, which are a property of the window object). But
  for keys of any other object, we'll want to some context for the name.

* Remove redundant test expect numbers. (Follows-up 7c36375c4c7007d)

* Ensure mw.Map.prototype.constructor points to mw.Map.
  This was broken by 5819c37b3, which accidentally made it point to Object.

Bug: T146432
Change-Id: I7ff0b230608f5ca582fc6752b59c4bb998c78ba2
maintenance/jsduck/categories.json
resources/src/mediawiki/mediawiki.js
resources/src/mediawiki/mediawiki.user.js
tests/qunit/data/testrunner.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js
tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js