From aa61a561f82b989365c8247b245bf2765106ec41 Mon Sep 17 00:00:00 2001 From: theMackabu Date: Wed, 10 Dec 2025 19:28:36 -0800 Subject: [PATCH] inline comma --- meson.build | 2 +- src/ant.c | 8 +++++++- tests/t5.js | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 tests/t5.js diff --git a/meson.build b/meson.build index 7a5a9e2..de45398 100644 --- a/meson.build +++ b/meson.build @@ -74,7 +74,7 @@ endif build_date = run_command('date', '+%Y-%m-%d', check: true).stdout().strip() version_conf = configuration_data() -version_conf.set('ANT_VERSION', '0.0.8.13') +version_conf.set('ANT_VERSION', '0.0.8.14') version_conf.set('ANT_GIT_HASH', git_hash) version_conf.set('ANT_BUILD_DATE', build_date) diff --git a/src/ant.c b/src/ant.c index f068a20..b0c8227 100644 --- a/src/ant.c +++ b/src/ant.c @@ -6924,7 +6924,13 @@ static jsval_t js_stmt(struct js *js) { case TOK_FOR: res = js_for(js); break; case TOK_RETURN: res = js_return(js); break; case TOK_TRY: res = js_try(js); break; - default: res = resolveprop(js, js_expr(js)); break; + default: + res = resolveprop(js, js_expr(js)); + while (next(js) == TOK_COMMA) { + js->consumed = 1; + res = resolveprop(js, js_expr(js)); + } + break; } bool is_block_statement = ( diff --git a/tests/t5.js b/tests/t5.js new file mode 100644 index 0000000..78f613e --- /dev/null +++ b/tests/t5.js @@ -0,0 +1 @@ +let o=[0,0,0,0,0,0,0,0,0];o[6]=o[6]&15|64,o[8]=o[8]&63|128;console.log(o) -- 2.51.2