]> git.kaiwu.me - quickjs.git/commitdiff
the %TypedArray% Intrinsic Object should be a constructor
authorFabrice Bellard <fabrice@bellard.org>
Mon, 21 Apr 2025 09:52:42 +0000 (11:52 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 21 Apr 2025 09:52:42 +0000 (11:52 +0200)
quickjs.c

index 8b0b04f447df7b834a4ce8290139836dd5740350..58b19d14f31e887aa7618e0f72b35d00df1eb007 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -54253,8 +54253,8 @@ void JS_AddIntrinsicTypedArrays(JSContext *ctx)
     JS_DefinePropertyValue(ctx, typed_array_base_proto, JS_ATOM_toString, obj,
                            JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE);
 
-    typed_array_base_func = JS_NewCFunction(ctx, js_typed_array_base_constructor,
-                                            "TypedArray", 0);
+    typed_array_base_func = JS_NewCFunction2(ctx, js_typed_array_base_constructor,
+                                             "TypedArray", 0, JS_CFUNC_constructor_or_func, 0);
     JS_SetPropertyFunctionList(ctx, typed_array_base_func,
                                js_typed_array_base_funcs,
                                countof(js_typed_array_base_funcs));