@@ -1244,6 +1244,8 @@ static __exception int js_get_length32(JSContext *ctx, uint32_t *pres,
12441244 JSValue obj);
12451245static __exception int js_get_length64(JSContext *ctx, int64_t *pres,
12461246 JSValue obj);
1247+ static __exception int js_set_length64(JSContext *ctx, JSValue obj,
1248+ int64_t len);
12471249static void free_arg_list(JSContext *ctx, JSValue *tab, uint32_t len);
12481250static JSValue *build_arg_list(JSContext *ctx, uint32_t *plen,
12491251 JSValue array_arg);
@@ -7092,6 +7094,10 @@ int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres) {
70927094 return js_get_length64(ctx, pres, obj);
70937095}
70947096
7097+ int JS_SetLength(JSContext *ctx, JSValue obj, int64_t len) {
7098+ return js_set_length64(ctx, obj, len);
7099+ }
7100+
70957101/* return TRUE, FALSE or (-1) in case of exception */
70967102static int JS_OrdinaryIsInstanceOf(JSContext *ctx, JSValue val,
70977103 JSValue obj)
@@ -37118,6 +37124,15 @@ static __exception int js_get_length64(JSContext *ctx, int64_t *pres,
3711837124 return JS_ToLengthFree(ctx, pres, len_val);
3711937125}
3712037126
37127+ static __exception int js_set_length64(JSContext *ctx, JSValue obj, int64_t len)
37128+ {
37129+ JSValue len_val;
37130+ len_val = JS_NewInt64(ctx, len);
37131+ if (JS_IsException(len_val))
37132+ return -1;
37133+ return JS_SetProperty(ctx, obj, JS_ATOM_length, len_val);
37134+ }
37135+
3712137136static void free_arg_list(JSContext *ctx, JSValue *tab, uint32_t len)
3712237137{
3712337138 uint32_t i;
0 commit comments