mediawiki.Title fix for IE.
authorKrinkle <krinkle@users.mediawiki.org>
Thu, 11 Aug 2011 12:36:00 +0000 (12:36 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Thu, 11 Aug 2011 12:36:00 +0000 (12:36 +0000)
commitf3c8623ee7a8e231f46b9505b10d44156f38a601
tree09694d5ba39c552f5b394d12c35d1433df5fde0c
parent3b5aa43bfc7c2aa93a050211876374d464b9e61a
mediawiki.Title fix for IE.

In normal browsers the matches-array contains null/undefined if there's no match, IE returns an empty string.

Changing the checks to really validate that it's a non-empty string, which means that from now on mw.Title will also throw an error on "new mw.Title('');", which makes it consistent with the PHP backend (Title::newFromText('') return null instead of an object).

Adding unit test to make sure this behavior is tracked from now on.

The _name and _ext properties are either left to their default (null) or set to a valid value.

So reverting the checks from r94066, and instead checking for empty string inside the byteLimit callback, that way mw.Title will not get the empty string in the first place.

(Follows-up r94066 CR)
resources/mediawiki/mediawiki.Title.js
tests/qunit/suites/resources/jquery/jquery.byteLimit.js
tests/qunit/suites/resources/mediawiki/mediawiki.Title.js