From 9e6d39bae6e02d437a73684a574da358d1e743ee Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sun, 1 Jan 2023 02:17:53 -0800 Subject: [internal] Add more bindings --- src/bun.js/bindings/bindings.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/bun.js/bindings/bindings.cpp') diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index f6f596fcb..b10fcc872 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -1688,6 +1688,20 @@ bool JSC__JSValue__asArrayBuffer_(JSC__JSValue JSValue0, JSC__JSGlobalObject* ar return false; } + +CPP_DECL JSC__JSValue JSC__JSValue__createEmptyArray(JSC__JSGlobalObject* arg0, size_t length) +{ + JSC::VM& vm = arg0->vm(); + return JSC::JSValue::encode(JSC::constructEmptyArray(arg0, nullptr, length)); +} +CPP_DECL void JSC__JSValue__putIndex(JSC__JSValue JSValue0, JSC__JSGlobalObject* arg1, uint32_t arg2, JSC__JSValue JSValue3) +{ + JSC::JSValue value = JSC::JSValue::decode(JSValue0); + JSC::JSValue value2 = JSC::JSValue::decode(JSValue3); + JSC::JSArray* array = JSC::jsCast(value); + array->putDirectIndex(arg1, arg2, value2); +} + JSC__JSValue JSC__JSValue__createStringArray(JSC__JSGlobalObject* globalObject, ZigString* arg1, size_t arg2, bool clone) { -- cgit v1.2.3