mediawiki.language: Fix infinite loop in commafy() when pattern has no grouping
authorSanthosh Thottingal <santhosh.thottingal@gmail.com>
Sat, 23 Aug 2014 12:52:03 +0000 (18:22 +0530)
committerSanthosh Thottingal <santhosh.thottingal@gmail.com>
Mon, 1 Sep 2014 11:57:42 +0000 (17:27 +0530)
commitcb7494830411c3609ff06376091cb755806dd0ec
tree3447ca201fa7e7bd339cb636c50c8a97a0680575
parentb65bbc2e7d9af826e94036480f7bef64e6c2b0dd
mediawiki.language: Fix infinite loop in commafy() when pattern has no grouping

When the decimal part of the pattern has no grouping, commafy was entering
into an infinite loop. Corrected the logic to handle this case.

Also added qunit tests.

Bug: 69835
Change-Id: I0f9e274411aead6a4e95402fd38c54ac6b76df53
resources/src/mediawiki.language/mediawiki.language.numbers.js
tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js