diff options
author | bptato <nincsnevem662@gmail.com> | 2024-04-14 18:48:52 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-04-14 19:00:24 +0200 |
commit | b0b3d6c0b9e04c6679c57bc9029268d30a6bd269 (patch) | |
tree | 3ea285fcfea7068d881739be025ff6cde2568d49 | |
parent | 74a91ab5b92052bb595795b9791b412e563ffa16 (diff) | |
download | chawan-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.c | 3 |
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) |