Skip to content

Commit fe0c843

Browse files
redfire75369sagudev
authored andcommitted
Added Wrapper for NewArrayBufferWithContents
Added Array Buffer Functions using `js::UniquePtr` to Bindgen Blacklist Signed-off-by: Redfire <[email protected]>
1 parent fb77828 commit fe0c843

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

mozjs-sys/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ const BLACKLIST_FUNCTIONS: &'static [&'static str] = &[
557557
"JS::GetScriptTranscodingBuildId",
558558
"JS::GetScriptedCallerPrivate",
559559
"JS::MaybeGetScriptPrivate",
560+
"JS::NewArrayBufferWithContents",
561+
"JS::NewExternalArrayBuffer",
560562
"JS::dbg::FireOnGarbageCollectionHook",
561563
"JS_EncodeStringToUTF8BufferPartial",
562564
"JS_GetEmptyStringValue",

mozjs-sys/src/jsapi.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ JSObject* NewExternalArrayBuffer(
107107
return NewExternalArrayBuffer(cx, nbytes, std::move(dataPtr));
108108
}
109109

110+
JSObject* NewArrayBufferWithContents(
111+
JSContext* cx, size_t nbytes, void* contents) {
112+
js::UniquePtr<void, JS::FreePolicy> dataPtr{contents};
113+
return NewArrayBufferWithContents(cx, nbytes, contents);
114+
}
115+
110116
// Reexport some methods
111117

112118
bool JS_ForOfIteratorInit(

0 commit comments

Comments
 (0)