aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/bindings.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-01 02:17:53 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-01 02:19:11 -0800
commit9e6d39bae6e02d437a73684a574da358d1e743ee (patch)
tree9047150ce5ad18d7e13eed4b127b3f121d99f12a /src/bun.js/bindings/bindings.cpp
parentf651f74f9d2ddb578aa2aa98f0146f17da087c23 (diff)
downloadbun-9e6d39bae6e02d437a73684a574da358d1e743ee.tar.gz
bun-9e6d39bae6e02d437a73684a574da358d1e743ee.tar.zst
bun-9e6d39bae6e02d437a73684a574da358d1e743ee.zip
[internal] Add more bindings
Diffstat (limited to 'src/bun.js/bindings/bindings.cpp')
-rw-r--r--src/bun.js/bindings/bindings.cpp14
1 files changed, 14 insertions, 0 deletions
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<JSC::JSArray*>(value);
+ array->putDirectIndex(arg1, arg2, value2);
+}
+
JSC__JSValue JSC__JSValue__createStringArray(JSC__JSGlobalObject* globalObject, ZigString* arg1,
size_t arg2, bool clone)
{