[quickjs-devel] [PATCH] Fix length of thrower/value thunks in Promise.prototype.finally

  • From: Gus Caplan <me@xxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Thu, 6 Feb 2020 09:01:29 -0800

These two functions are defined with a length of 0, not 1.

---
 quickjs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/quickjs.c b/quickjs.c
index b19a4d9..c3d15a5 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -45234,10 +45234,10 @@ static JSValue
js_promise_then_finally_func(JSContext *ctx, JSValueConst this_va
     }
     JS_FreeValue(ctx, ret);
     if (magic == 0) {
-        then_func = JS_NewCFunctionData(ctx,
js_promise_finally_value_thunk, 1,
+        then_func = JS_NewCFunctionData(ctx,
js_promise_finally_value_thunk, 0,
                                         0, 1, argv);
     } else {
-        then_func = JS_NewCFunctionData(ctx, js_promise_finally_thrower, 1,
+        then_func = JS_NewCFunctionData(ctx, js_promise_finally_thrower, 0,
                                         0, 1, argv);
     }
     if (JS_IsException(then_func)) {
-- 
2.25.0

Other related posts: