From b0b3d6c0b9e04c6679c57bc9029268d30a6bd269 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 14 Apr 2024 18:48:52 +0200 Subject: quickjs: fix member accesses for non-decimal number literals e.g. 0x0.a should return undefined, not SyntaxError. --- lib/quickjs/quickjs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit 1.4.1-2-gfad0