Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: src/builtins/builtins-number.cc

Issue 2520363002: Reimplement Number.prototype.toString with non-default radix. (Closed)
Patch Set: readd copyright headers Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-number.cc
diff --git a/src/builtins/builtins-number.cc b/src/builtins/builtins-number.cc
index a63066cfbd7857b42cdf99db8d646f68feae2b6b..cddfe241e2f78de0e195ba7a6b58f163a1055aaa 100644
--- a/src/builtins/builtins-number.cc
+++ b/src/builtins/builtins-number.cc
@@ -545,7 +545,8 @@ BUILTIN(NumberPrototypeToString) {
}
// Fast case where the result is a one character string.
- if (IsUint32Double(value_number) && value_number < radix_number) {
+ if ((IsUint32Double(value_number) && value_number < radix_number) ||
+ value_number == -0.0) {
Jakob Kummerow 2016/11/28 12:15:11 DBC: This is misleading, because "value_number ==
Yang 2016/11/28 12:20:21 Noted. I originally had compared to 0.0 in patch s
// Character array used for conversion.
static const char kCharTable[] = "0123456789abcdefghijklmnopqrstuvwxyz";
return *isolate->factory()->LookupSingleCharacterStringFromCode(
« no previous file with comments | « no previous file | src/conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698