Index: src/conversions-inl.h |
diff --git a/src/conversions-inl.h b/src/conversions-inl.h |
index 595ae9ed5b3401bb9b0eea8f3576869fdcd39e92..2f0a399d1a4d951296f933a35a3a40e90f954693 100644 |
--- a/src/conversions-inl.h |
+++ b/src/conversions-inl.h |
@@ -515,6 +515,32 @@ double InternalStringToDouble(UnicodeCache* unicode_cache, |
end, |
false, |
allow_trailing_junk); |
+ |
+ // It could be an explicit octal value. |
+ } else if ((flags & ALLOW_OCTAL) && (*current == 'o' || *current == 'O')) { |
+ ++current; |
+ if (current == end || !isDigit(*current, 8) || sign != NONE) { |
+ return JunkStringValue(); // "0o". |
+ } |
+ |
+ return InternalStringToIntDouble<3>(unicode_cache, |
+ current, |
+ end, |
+ false, |
+ allow_trailing_junk); |
+ |
+ // It could be a binary value. |
+ } else if ((flags & ALLOW_BINARY) && (*current == 'b' || *current == 'B')) { |
+ ++current; |
+ if (current == end || !isBinaryDigit(*current) || sign != NONE) { |
+ return JunkStringValue(); // "0b". |
+ } |
+ |
+ return InternalStringToIntDouble<1>(unicode_cache, |
+ current, |
+ end, |
+ false, |
+ allow_trailing_junk); |
} |
// Ignore leading zeros in the integer part. |
@@ -524,7 +550,7 @@ double InternalStringToDouble(UnicodeCache* unicode_cache, |
} |
} |
- bool octal = leading_zero && (flags & ALLOW_OCTALS) != 0; |
+ bool octal = leading_zero && (flags & ALLOW_IMPLICIT_OCTAL) != 0; |
// Copy significant digits of the integer part (if any) to the buffer. |
while (*current >= '0' && *current <= '9') { |