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

Unified Diff: src/conversions.cc

Issue 225823003: Implement handlified String::Equals and Name::Equals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: refactored StringToDouble Created 6 years, 8 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/conversions.h ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.cc
diff --git a/src/conversions.cc b/src/conversions.cc
index 9c52d41e5d3f42bc0deda9ac1ebd70059da1f00a..1d5ed35f93c83510146bb4bf518bbc51347d8672 100644
--- a/src/conversions.cc
+++ b/src/conversions.cc
@@ -56,7 +56,7 @@ double StringToDouble(UnicodeCache* unicode_cache,
double StringToDouble(UnicodeCache* unicode_cache,
- Vector<const char> str,
+ Vector<const uint8_t> str,
int flags,
double empty_string_val) {
// We cast to const uint8_t* here to avoid instantiating the
@@ -78,6 +78,23 @@ double StringToDouble(UnicodeCache* unicode_cache,
}
+// Converts a string into an integer.
+double StringToInt(UnicodeCache* unicode_cache,
+ Vector<const uint8_t> vector,
+ int radix) {
+ return InternalStringToInt(
+ unicode_cache, vector.start(), vector.start() + vector.length(), radix);
+}
+
+
+double StringToInt(UnicodeCache* unicode_cache,
+ Vector<const uc16> vector,
+ int radix) {
+ return InternalStringToInt(
+ unicode_cache, vector.start(), vector.start() + vector.length(), radix);
+}
+
+
const char* DoubleToCString(double v, Vector<char> buffer) {
switch (fpclassify(v)) {
case FP_NAN: return "NaN";
« no previous file with comments | « src/conversions.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698