]> git.kaiwu.me - quickjs.git/commitdiff
fixed returned value of empty catch blocks
authorFabrice Bellard <fabrice@bellard.org>
Mon, 28 Sep 2026 12:16:33 +0000 (14:16 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 28 Sep 2026 12:16:33 +0000 (14:16 +0200)
quickjs.c
test262_errors.txt

index add115b33c2d4badbf94ce7f460907e1b66f70df..d209b001eaa476bea4c05902faba14526190a3d6 100644 (file)
--- 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;
 
index 340bef5afbcdbd95b33c13e5591ee81e1a164ade..be9100150f185fd80dde0c898736ac1524e0fa03 100644 (file)
@@ -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