ref: eed403069fbd52d3d5cada6d504039f4ac3f5949
parent: dc386479da124f5c3dd021c530aadf8ec22eee78
author: Tor Andersson <tor@ccxvii.net>
date: Wed Mar 12 10:35:41 EDT 2014
Use strtod when lexing numbers.
--- a/jslex.c
+++ b/jslex.c
@@ -277,6 +277,7 @@
static int lexnumber(js_State *J)
{
+ const char *s = J->source - 1;
double n;
double e;
@@ -309,7 +310,7 @@
if (jsY_isidentifierstart(PEEK))
jsY_error(J, "number with letter suffix");
- J->number = n;
+ J->number = strtod(s, NULL);
return TK_NUMBER;
}