dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Disable JavaScript for MSIE7 users, update tests accordingly"
[lhc/web/wiklou.git]
/
resources
/
src
/
mediawiki.language
/
mediawiki.language.numbers.js
diff --git
a/resources/src/mediawiki.language/mediawiki.language.numbers.js
b/resources/src/mediawiki.language/mediawiki.language.numbers.js
index
56fa0da
..
a0b8141
100644
(file)
--- a/
resources/src/mediawiki.language/mediawiki.language.numbers.js
+++ b/
resources/src/mediawiki.language/mediawiki.language.numbers.js
@@
-34,7
+34,7
@@
}
/**
}
/**
- *
Efficiently replicate a string `n`
times.
+ *
Replicate a string 'n'
times.
*
* @private
* @param {string} str The string to replicate
*
* @private
* @param {string} str The string to replicate
@@
-47,9
+47,8
@@
}
var buf = [];
}
var buf = [];
- while (
num
) {
+ while (
num--
) {
buf.push( str );
buf.push( str );
- str += str;
}
return buf.join( '' );
}
}
return buf.join( '' );
}
@@
-103,7
+102,7
@@
// Truncate fractional
if ( maxPlaces < fractional.length ) {
// Truncate fractional
if ( maxPlaces < fractional.length ) {
- valueParts[1] = fractional.s
ubstr
( 0, maxPlaces );
+ valueParts[1] = fractional.s
lice
( 0, maxPlaces );
}
} else {
if ( valueParts[1] ) {
}
} else {
if ( valueParts[1] ) {
@@
-125,7
+124,7
@@
// Truncate whole
if ( patternDigits.indexOf( '#' ) === -1 ) {
// Truncate whole
if ( patternDigits.indexOf( '#' ) === -1 ) {
- valueParts[0] = valueParts[0].s
ubstr
( valueParts[0].length - padLength );
+ valueParts[0] = valueParts[0].s
lice
( valueParts[0].length - padLength );
}
}
}
}
@@
-134,7
+133,7
@@
if ( index !== -1 ) {
groupSize = patternParts[0].length - index - 1;
if ( index !== -1 ) {
groupSize = patternParts[0].length - index - 1;
- remainder = patternParts[0].s
ubstr
( 0, index );
+ remainder = patternParts[0].s
lice
( 0, index );
index = remainder.lastIndexOf( ',' );
if ( index !== -1 ) {
groupSize2 = remainder.length - index - 1;
index = remainder.lastIndexOf( ',' );
if ( index !== -1 ) {
groupSize2 = remainder.length - index - 1;
@@
-142,13
+141,13
@@
}
for ( whole = valueParts[0]; whole; ) {
}
for ( whole = valueParts[0]; whole; ) {
- off = whole.length - groupSize;
-
- pieces.push( ( off > 0 ) ? whole.substr( off ) : whole );
+ off = groupSize ? whole.length - groupSize : 0;
+ pieces.push( ( off > 0 ) ? whole.slice( off ) : whole );
whole = ( off > 0 ) ? whole.slice( 0, off ) : '';
if ( groupSize2 ) {
groupSize = groupSize2;
whole = ( off > 0 ) ? whole.slice( 0, off ) : '';
if ( groupSize2 ) {
groupSize = groupSize2;
+ groupSize2 = null;
}
}
valueParts[0] = pieces.reverse().join( options.group );
}
}
valueParts[0] = pieces.reverse().join( options.group );