if (radix == 0) {
// Radix detection.
+ radix = 10;
if (*current == '0') {
++current;
if (current == end) return SignedZero(negative);
++current;
if (current == end) return JunkStringValue();
} else {
- radix = 8;
leading_zero = true;
}
- } else {
- radix = 10;
}
} else if (radix == 16) {
if (*current == '0') {
assertEquals(0, parseInt(' 0'));
assertEquals(0, parseInt(' 0 '));
-assertEquals(63, parseInt('077'));
-assertEquals(63, parseInt(' 077'));
-assertEquals(63, parseInt(' 077 '));
-assertEquals(-63, parseInt(' -077'));
+assertEquals(77, parseInt('077'));
+assertEquals(77, parseInt(' 077'));
+assertEquals(77, parseInt(' 077 '));
+assertEquals(-77, parseInt(' -077'));
assertEquals(3, parseInt('11', 2));
assertEquals(4, parseInt('11', 3));
##################### DELIBERATE INCOMPATIBILITIES #####################
-# We deliberately treat arguments to parseInt() with a leading zero as
-# octal numbers in order to not break the web.
-S15.1.2.2_A5.1_T1: FAIL_OK
-
# This tests precision of Math.tan and Math.sin. The implementation for those
# trigonometric functions are platform/compiler dependent. Furthermore, the
# expectation values by far deviates from the actual result given by an