@@ -1244,6 +1244,8 @@ static __exception int js_get_length32(JSContext *ctx, uint32_t *pres,
1244
1244
JSValue obj);
1245
1245
static __exception int js_get_length64(JSContext *ctx, int64_t *pres,
1246
1246
JSValue obj);
1247
+ static __exception int js_set_length64(JSContext *ctx, JSValue obj,
1248
+ int64_t len);
1247
1249
static void free_arg_list(JSContext *ctx, JSValue *tab, uint32_t len);
1248
1250
static JSValue *build_arg_list(JSContext *ctx, uint32_t *plen,
1249
1251
JSValue array_arg);
@@ -7092,6 +7094,10 @@ int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres) {
7092
7094
return js_get_length64(ctx, pres, obj);
7093
7095
}
7094
7096
7097
+ int JS_SetLength(JSContext *ctx, JSValue obj, int64_t len) {
7098
+ return js_set_length64(ctx, obj, len);
7099
+ }
7100
+
7095
7101
/* return TRUE, FALSE or (-1) in case of exception */
7096
7102
static int JS_OrdinaryIsInstanceOf(JSContext *ctx, JSValue val,
7097
7103
JSValue obj)
@@ -37118,6 +37124,15 @@ static __exception int js_get_length64(JSContext *ctx, int64_t *pres,
37118
37124
return JS_ToLengthFree(ctx, pres, len_val);
37119
37125
}
37120
37126
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
+
37121
37136
static void free_arg_list(JSContext *ctx, JSValue *tab, uint32_t len)
37122
37137
{
37123
37138
uint32_t i;
0 commit comments