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

Unified Diff: src/conversions.h

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/char-predicates-inl.h ('k') | src/conversions-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.h
diff --git a/src/conversions.h b/src/conversions.h
index 1fbb5f11821864320cc95843ccfd41bd89c705c2..7aa2d3fb3a88716fc8b7fe1dbfb21e8a7a225517 100644
--- a/src/conversions.h
+++ b/src/conversions.h
@@ -52,6 +52,11 @@ inline bool isDigit(int x, int radix) {
}
+inline bool isBinaryDigit(int x) {
+ return x == '0' || x == '1';
+}
+
+
// The fast double-to-(unsigned-)int conversion routine does not guarantee
// rounding towards zero.
// For NaN and values outside the int range, return INT_MIN or INT_MAX.
@@ -108,8 +113,10 @@ inline uint32_t DoubleToUint32(double x) {
enum ConversionFlags {
NO_FLAGS = 0,
ALLOW_HEX = 1,
- ALLOW_OCTALS = 2,
- ALLOW_TRAILING_JUNK = 4
+ ALLOW_OCTAL = 2,
+ ALLOW_IMPLICIT_OCTAL = 4,
+ ALLOW_BINARY = 8,
+ ALLOW_TRAILING_JUNK = 16
};
« no previous file with comments | « src/char-predicates-inl.h ('k') | src/conversions-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698