about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-14 18:48:52 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-14 19:00:24 +0200
commitb0b3d6c0b9e04c6679c57bc9029268d30a6bd269 (patch)
tree3ea285fcfea7068d881739be025ff6cde2568d49
parent74a91ab5b92052bb595795b9791b412e563ffa16 (diff)
downloadchawan-b0b3d6c0b9e04c6679c57bc9029268d30a6bd269.tar.gz
quickjs: fix member accesses for non-decimal number literals
e.g. 0x0.a should return undefined, not SyntaxError.
-rw-r--r--lib/quickjs/quickjs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c
index 1fb0f824..0da7e13f 100644
--- a/lib/quickjs/quickjs.c
+++ b/lib/quickjs/quickjs.c
@@ -10407,7 +10407,8 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp,
         p++;
     }
     if (!(flags & ATOD_INT_ONLY)) {
-        if (*p == '.' && (p > p_start || to_digit((uint8_t)p[1]) < radix)) {
+        if (*p == '.' && radix == 10 &&
+            (p > p_start || to_digit((uint8_t)p[1]) < radix)) {
             is_float = TRUE;
             p++;
             if (*p == sep)