Index: src/runtime/runtime-numbers.cc |
diff --git a/src/runtime/runtime-numbers.cc b/src/runtime/runtime-numbers.cc |
index f976df951c119a3fba5f63fe33c33ad8574c1124..77e29f7168aa077fce36c754f019f246a2fd1ad7 100644 |
--- a/src/runtime/runtime-numbers.cc |
+++ b/src/runtime/runtime-numbers.cc |
@@ -114,11 +114,13 @@ RUNTIME_FUNCTION(Runtime_StringToNumber) { |
} |
+// ES6 18.2.5 parseInt(string, radix) slow path |
RUNTIME_FUNCTION(Runtime_StringParseInt) { |
HandleScope handle_scope(isolate); |
DCHECK(args.length() == 2); |
CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); |
CONVERT_NUMBER_CHECKED(int, radix, Int32, args[1]); |
+ // Step 8.a. is already handled in the JS function. |
RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36)); |
subject = String::Flatten(subject); |
@@ -128,7 +130,6 @@ RUNTIME_FUNCTION(Runtime_StringParseInt) { |
DisallowHeapAllocation no_gc; |
String::FlatContent flat = subject->GetFlatContent(); |
- // ECMA-262 section 15.1.2.3, empty string is NaN |
if (flat.IsOneByte()) { |
value = |
StringToInt(isolate->unicode_cache(), flat.ToOneByteVector(), radix); |
@@ -141,6 +142,7 @@ RUNTIME_FUNCTION(Runtime_StringParseInt) { |
} |
+// ES6 18.2.4 parseFloat(string) |
RUNTIME_FUNCTION(Runtime_StringParseFloat) { |
HandleScope shs(isolate); |
DCHECK(args.length() == 1); |