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

Unified Diff: src/runtime/runtime-numbers.cc

Issue 1512903002: [v8natives.js] updating comments to ES6 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: even less parseInt code changes Created 5 years 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 | « src/js/v8natives.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/js/v8natives.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698