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

Unified Diff: src/runtime.cc

Issue 587873002: ES6: Disallow binary and octal representation in Number (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months 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 | test/mjsunit/harmony/numeric-literals.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 3acbb81d89dff0c0d2c21003762bb785c6a7df85..7f13fbca9e809cb39283a9530c6bbb15b46251cf 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -6284,15 +6284,9 @@ RUNTIME_FUNCTION(Runtime_StringToNumber) {
}
// Slower case.
- int flags = ALLOW_HEX;
- if (FLAG_harmony_numeric_literals) {
- // The current spec draft has not updated "ToNumber Applied to the String
- // Type", https://bugs.ecmascript.org/show_bug.cgi?id=1584
- flags |= ALLOW_OCTAL | ALLOW_BINARY;
- }
-
- return *isolate->factory()->NewNumber(StringToDouble(
- isolate->unicode_cache(), *subject, flags));
+ // Octal and binary are not allowed in ToNumber.
+ return *isolate->factory()->NewNumber(
+ StringToDouble(isolate->unicode_cache(), *subject, ALLOW_HEX));
}
« no previous file with comments | « no previous file | test/mjsunit/harmony/numeric-literals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698