Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ extern "C" {
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: JS::MutableHandleValue);
pub fn JS_GetScriptPrivate(script: *mut JSScript, dest: JS::MutableHandleValue);
pub fn JS_GetModulePrivate(module: *mut JSObject, 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: 2 additions & 0 deletions src/glue_wrappers.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ wrap!(glue: pub fn RUST_INTERNED_STRING_TO_JSID(cx: *mut JSContext, str: *mut JS
wrap!(glue: pub fn GetIdVectorAddress(v: *mut PersistentRootedIdVector) -> *mut ::libc::c_void);
wrap!(glue: pub fn AppendToIdVector(v: MutableHandleIdVector, id: HandleId) -> bool);
wrap!(glue: pub fn JS_GetPromiseResult (promise: HandleObject, dest: MutableHandleValue));
wrap!(glue: pub fn JS_GetScriptPrivate(script: *mut JSScript, dest: MutableHandleValue));
wrap!(glue: pub fn JS_GetModulePrivate(module: *mut JSObject, dest: MutableHandleValue));
wrap!(glue: pub fn EncodeStringToUTF8(cx: *mut JSContext, str: HandleString, cb: fn(*const c_char)));
11 changes: 11 additions & 0 deletions src/jsglue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "js/Class.h"
#include "js/Id.h"
#include "js/MemoryMetrics.h"
#include "js/Modules.h" // include for JS::GetModulePrivate
#include "js/Principals.h"
#include "js/Promise.h"
#include "js/Proxy.h"
Expand Down Expand Up @@ -1077,6 +1078,16 @@ JS_GetPromiseResult(JS::HandleObject promise, JS::MutableHandleValue dest) {
dest.set(JS::GetPromiseResult(promise));
}

void
JS_GetScriptPrivate(JSScript* script, JS::MutableHandleValue dest) {
dest.set(JS::GetScriptPrivate(script));
}

void
JS_GetModulePrivate(JSObject* module, JS::MutableHandleValue dest) {
dest.set(JS::GetModulePrivate(module));
}

void
JS_GetNaNValue(JSContext* cx, JS::Value* dest) {
*dest = JS::NaNValue();
Expand Down