Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
Accept a mutable handle in JS_GetPromiseResult.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdm committed Aug 30, 2019
1 parent ab48ca7 commit 9effecf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ extern "C" {
pub fn WriteBytesToJSStructuredCloneData(src: *const u8, len: usize, dest: *mut JSStructuredCloneData);
pub fn JS_ComputeThis (cx: *mut JSContext , vp: *mut JS::Value, dest: *mut JS::Value);
pub fn JS_GetModuleHostDefinedField (module: *mut JSObject, dest: *mut JS::Value);
pub fn JS_GetPromiseResult (promise: JS::HandleObject, dest: *mut JS::Value);
pub fn JS_GetPromiseResult (promise: JS::HandleObject, dest: JS::MutableHandleValue);
pub fn JS_THIS (cx: *mut JSContext , vp: *mut JS::Value, dest: *mut JS::Value);
pub fn JS_GetNaNValue (cx: *mut JSContext, dest: *mut JS::Value);
pub fn JS_GetPositiveInfinityValue (cx: *mut JSContext, dest: *mut JS::Value);
Expand Down
2 changes: 1 addition & 1 deletion src/glue_wrappers.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ wrap!(glue: pub fn RUST_SYMBOL_TO_JSID(sym: *mut Symbol, id: MutableHandleId));
wrap!(glue: pub fn int_to_jsid(i: i32, id: MutableHandleId));
wrap!(glue: pub fn RUST_INTERNED_STRING_TO_JSID(cx: *mut JSContext, str: *mut JSString, id: MutableHandleId));
wrap!(glue: pub fn AppendToAutoIdVector(v: *mut AutoIdVector, id: HandleId) -> bool);
wrap!(glue: pub fn JS_GetPromiseResult (promise: HandleObject, dest: *mut Value));
wrap!(glue: pub fn JS_GetPromiseResult (promise: HandleObject, dest: MutableHandleValue));
wrap!(glue: pub fn EncodeStringToUTF8(cx: *mut JSContext, str: HandleString, cb: fn(*const c_char)));
4 changes: 2 additions & 2 deletions src/jsglue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,8 +1036,8 @@ WriteBytesToJSStructuredCloneData(const uint8_t* src, size_t len, JSStructuredCl
// https://mozilla.logbot.info/jsapi/20180622#c14918658

void
JS_GetPromiseResult(JS::HandleObject promise, JS::Value* dest) {
*dest = JS::GetPromiseResult(promise);
JS_GetPromiseResult(JS::HandleObject promise, JS::MutableHandleValue dest) {
dest.set(JS::GetPromiseResult(promise));
}

void
Expand Down

0 comments on commit 9effecf

Please sign in to comment.