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

Unified Diff: src/runtime.cc

Issue 19300002: ES6: Add support for explicit octal and binary integer literals (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix long lines Created 7 years, 5 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 | « src/preparser.cc ('k') | src/scanner.h » ('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 8391bef9490d150e6318de906020622029737a53..3b721f7c93a83e08dc4a3f95d8a7767d5c732f44 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5959,8 +5959,14 @@ RUNTIME_FUNCTION(MaybeObject*, 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->heap()->NumberFromDouble(
- StringToDouble(isolate->unicode_cache(), subject, ALLOW_HEX));
+ StringToDouble(isolate->unicode_cache(), subject, flags));
}
« no previous file with comments | « src/preparser.cc ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698