Skip to content

Commit a2accf8

Browse files
committed
QuickJS: fixed SharedDict.incr() with empty init argument.
1 parent 54f18a1 commit a2accf8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nginx/ngx_js_shared_dict.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,10 @@ ngx_qjs_ext_shared_dict_incr(JSContext *cx, JSValueConst this_val,
22192219
return JS_EXCEPTION;
22202220
}
22212221

2222-
if (JS_ToFloat64(cx, &init, argv[2]) < 0) {
2222+
if (JS_IsUndefined(argv[2])) {
2223+
init = 0;
2224+
2225+
} else if (JS_ToFloat64(cx, &init, argv[2]) < 0) {
22232226
return JS_EXCEPTION;
22242227
}
22252228

0 commit comments

Comments
 (0)