Committed: http://code.google.com/p/v8/source/detail?r=4331
Review URL: http://codereview.chromium.org/1572004
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4339
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
bool minus = (data[0] == '-');
int start_pos = (minus ? 1 : 0);
- if (start_pos == len || data[start_pos] > '9') {
+ if (start_pos == len) {
+ return Heap::nan_value();
+ } else if (data[start_pos] > '9') {
// Fast check for a junk value. A valid string may start from a
// whitespace, a sign ('+' or '-'), the decimal point, a decimal digit or
// the 'I' character ('Infinity'). All of that have codes not greater than