diff options
author | 2023-07-14 18:34:09 -0700 | |
---|---|---|
committer | 2023-07-17 20:27:54 -0700 | |
commit | 1becd014facbf4ebd40f9629a10f53f2a485e4e1 (patch) | |
tree | 9c1da876f9898c7f872f1a8b75f47d1e9ef3f195 /src/bun.js | |
parent | 6924134cd54285b4da7c38bf632fbe098b9e5c54 (diff) | |
download | bun-1becd014facbf4ebd40f9629a10f53f2a485e4e1.tar.gz bun-1becd014facbf4ebd40f9629a10f53f2a485e4e1.tar.zst bun-1becd014facbf4ebd40f9629a10f53f2a485e4e1.zip |
boop
Diffstat (limited to 'src/bun.js')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 5 | ||||
-rw-r--r-- | src/bun.js/bindings/headers.h | 40 |
2 files changed, 42 insertions, 3 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 923dc0010..12840aceb 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -1390,7 +1390,7 @@ extern "C" JSC__JSValue Bun__createArrayBufferForCopy(JSC::JSGlobalObject* globa return JSC::JSValue::encode(JSC::JSValue {}); } - if (len > 0) + if (len > 0 && ptr) memcpy(arrayBuffer->data(), ptr, len); RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTFMove(arrayBuffer)))); @@ -1409,7 +1409,7 @@ extern "C" JSC__JSValue Bun__createUint8ArrayForCopy(JSC::JSGlobalObject* global return JSC::JSValue::encode(JSC::JSValue {}); } - if (len > 0) + if (len > 0 && ptr) memcpy(array->vector(), ptr, len); RELEASE_AND_RETURN(scope, JSValue::encode(array)); @@ -4241,7 +4241,6 @@ void GlobalObject::installAPIGlobals(JSClassRef* globals, int count, JSC::VM& vm JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly); } - { JSC::Identifier identifier = JSC::Identifier::fromString(vm, "BrotliCompressorSink"_s); object->putDirectCustomAccessor(vm, identifier, JSC::CustomGetterSetter::create(vm, functionBrotliCompressorSink__getter, nullptr), diff --git a/src/bun.js/bindings/headers.h b/src/bun.js/bindings/headers.h index 206a7e27c..02631d749 100644 --- a/src/bun.js/bindings/headers.h +++ b/src/bun.js/bindings/headers.h @@ -715,6 +715,46 @@ ZIG_DECL void FileSink__updateRef(void* arg0, bool arg1); ZIG_DECL JSC__JSValue FileSink__write(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); #endif +CPP_DECL JSC__JSValue BrotliDecompressorSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__JSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__JSValue BrotliDecompressorSink__createObject(JSC__JSGlobalObject* arg0, void* arg1); +CPP_DECL void BrotliDecompressorSink__detachPtr(JSC__JSValue JSValue0); +CPP_DECL void* BrotliDecompressorSink__fromJS(JSC__JSGlobalObject* arg0, JSC__JSValue JSValue1); +CPP_DECL void BrotliDecompressorSink__onClose(JSC__JSValue JSValue0, JSC__JSValue JSValue1); +CPP_DECL void BrotliDecompressorSink__onReady(JSC__JSValue JSValue0, JSC__JSValue JSValue1, JSC__JSValue JSValue2); + +#ifdef __cplusplus + +ZIG_DECL JSC__JSValue BrotliDecompressorSink__close(JSC__JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__JSValue BrotliDecompressorSink__construct(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL JSC__JSValue BrotliDecompressorSink__end(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL JSC__JSValue BrotliDecompressorSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); +ZIG_DECL void BrotliDecompressorSink__finalize(void* arg0); +ZIG_DECL JSC__JSValue BrotliDecompressorSink__flush(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL JSC__JSValue BrotliDecompressorSink__start(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL void BrotliDecompressorSink__updateRef(void* arg0, bool arg1); +ZIG_DECL JSC__JSValue BrotliDecompressorSink__write(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); + +#endif +CPP_DECL JSC__JSValue BrotliCompressorSink__assignToStream(JSC__JSGlobalObject* arg0, JSC__JSValue JSValue1, void* arg2, void** arg3); +CPP_DECL JSC__JSValue BrotliCompressorSink__createObject(JSC__JSGlobalObject* arg0, void* arg1); +CPP_DECL void BrotliCompressorSink__detachPtr(JSC__JSValue JSValue0); +CPP_DECL void* BrotliCompressorSink__fromJS(JSC__JSGlobalObject* arg0, JSC__JSValue JSValue1); +CPP_DECL void BrotliCompressorSink__onClose(JSC__JSValue JSValue0, JSC__JSValue JSValue1); +CPP_DECL void BrotliCompressorSink__onReady(JSC__JSValue JSValue0, JSC__JSValue JSValue1, JSC__JSValue JSValue2); + +#ifdef __cplusplus + +ZIG_DECL JSC__JSValue BrotliCompressorSink__close(JSC__JSGlobalObject* arg0, void* arg1); +ZIG_DECL JSC__JSValue BrotliCompressorSink__construct(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL JSC__JSValue BrotliCompressorSink__end(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL JSC__JSValue BrotliCompressorSink__endWithSink(void* arg0, JSC__JSGlobalObject* arg1); +ZIG_DECL void BrotliCompressorSink__finalize(void* arg0); +ZIG_DECL JSC__JSValue BrotliCompressorSink__flush(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL JSC__JSValue BrotliCompressorSink__start(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); +ZIG_DECL void BrotliCompressorSink__updateRef(void* arg0, bool arg1); +ZIG_DECL JSC__JSValue BrotliCompressorSink__write(JSC__JSGlobalObject* arg0, JSC__CallFrame* arg1); + +#endif #ifdef __cplusplus |