mw.Map: Avoid using 'undefined' to check for real existance.
authorTimo Tijhof <ttijhof@wikimedia.org>
Sun, 24 Feb 2013 14:42:16 +0000 (15:42 +0100)
committerKrinkle <ttijhof@wikimedia.org>
Tue, 5 Mar 2013 02:13:52 +0000 (02:13 +0000)
commitf15fab4b8396ccba6da54023b81888cfc9483002
tree73df39fe1b99a643d81855d16613bc231b75b06e
parent5e6e13b40140584a029837b550536f2cde3a9da3
mw.Map: Avoid using 'undefined' to check for real existance.

Instead use hasOwnProperty or arguments.length when checking
for existance of object propertys and arguments respectively.

That way the following work as expected:

var a = new mw.Map();

a.get( 'constructor' );
// Should be `null`
// Was `function Object() { [native code] }

a.get( 'something', undefined );
// Should be `undefined`
// Was `null`

Bug: 45330
Bug: 45331
Change-Id: I035e23f700e2120618ed4fbe5ce95c7f9b947e41
resources/mediawiki/mediawiki.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js