From: Fabrice Bellard Date: Mon, 28 Sep 2026 12:16:33 +0000 (+0200) Subject: fixed returned value of empty catch blocks X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=49842490280131d1bd020c650808e807565a8ba4;p=quickjs.git fixed returned value of empty catch blocks --- diff --git a/quickjs.c b/quickjs.c index add115b..d209b00 100644 --- a/quickjs.c +++ b/quickjs.c @@ -29545,7 +29545,6 @@ static __exception int js_parse_statement_or_decl(JSParseState *s, JSAtom name; BlockEnv block_env; - set_eval_ret_undefined(s); if (next_token(s)) goto fail; label_catch = new_label(s); @@ -29559,6 +29558,7 @@ static __exception int js_parse_statement_or_decl(JSParseState *s, JS_ATOM_NULL, -1, -1, 1); block_env.label_finally = label_finally; + set_eval_ret_undefined(s); if (js_parse_block(s)) goto fail; @@ -29620,6 +29620,7 @@ static __exception int js_parse_statement_or_decl(JSParseState *s, -1, -1, 1); block_env.label_finally = label_finally; + set_eval_ret_undefined(s); if (js_parse_block(s)) goto fail; diff --git a/test262_errors.txt b/test262_errors.txt index 340bef5..be91001 100644 --- a/test262_errors.txt +++ b/test262_errors.txt @@ -48,4 +48,3 @@ test262/test/staging/sm/object/defineProperties-order.js:11: Test262Error: Expec test262/test/staging/sm/regress/regress-602621.js:13: Test262Error: function sub-statement must override arguments Expected SameValue(«"function"», «"object"») to be true test262/test/staging/sm/regress/regress-1383630.js:28: Test262Error: proxy must report the same value for the non-writable, non-configurable property Expected a TypeError to be thrown but no exception was thrown at all test262/test/staging/sm/statements/arrow-function-in-for-statement-head.js:13: Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all -test262/test/staging/sm/statements/try-completion.js:11: Test262Error: Expected SameValue(«"try"», «undefined») to be true