mw.loader: Return consistent object shape from splitModuleKey()
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 30 Sep 2017 17:35:13 +0000 (18:35 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 30 Sep 2017 17:35:13 +0000 (18:35 +0100)
commitb70bcab4868950b55cbc32728717853d3d603ebd
tree61c11482af061408c4062bb24032ae2fe94c189d
parent5eedf48c5a3a4265109319f2cf0a065d04697e1b
mw.loader: Return consistent object shape from splitModuleKey()

This is used in mw.loader.implement() in a truthy check before
assigning as value of `registry[module].version`.

Both implicit undefined and empty string are falsey so the
behaviour is unchanged.

This reduces shape variability for JS engines, and also avoid
potential mistakes if the function is used elsewhere since
internally the registry, as maintained by mw.loader.register(),
uses empty string as default for version, not undefined.

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