|
std::string | ToString (const ScriptRequest &rq, JS::MutableHandleValue obj, bool pretty=false) |
| Convert an object to a UTF-8 encoded string, either with JSON (if pretty == true and there is no JSON error) or with toSource(). More...
|
|
bool | ParseJSON (const ScriptRequest &rq, const std::string &string_utf8, JS::MutableHandleValue out) |
| Parse a UTF-8-encoded JSON string. More...
|
|
void | ReadJSONFile (const ScriptRequest &rq, const VfsPath &path, JS::MutableHandleValue out) |
| Read a JSON file. More...
|
|
std::string | StringifyJSON (const ScriptRequest &rq, JS::MutableHandleValue obj, bool indent=true) |
| Stringify to a JSON string, UTF-8 encoded. More...
|
|
template<typename PropType > |
bool | GetProperty (const ScriptRequest &rq, JS::HandleValue obj, PropType name, JS::MutableHandleValue out) |
| Get the named property on the given object. More...
|
|
template<typename T , typename PropType > |
bool | GetProperty (const ScriptRequest &rq, JS::HandleValue obj, PropType name, T &out) |
|
bool | GetProperty (const ScriptRequest &rq, JS::HandleValue obj, const char *name, JS::MutableHandleObject out) |
|
template<typename T > |
bool | GetPropertyInt (const ScriptRequest &rq, JS::HandleValue obj, int name, T &out) |
|
bool | GetPropertyInt (const ScriptRequest &rq, JS::HandleValue obj, int name, JS::MutableHandleValue out) |
|
bool | HasProperty (const ScriptRequest &rq, JS::HandleValue obj, const char *name) |
| Check the named property has been defined on the given object. More...
|
|
template<typename PropType > |
bool | SetProperty (const ScriptRequest &rq, JS::HandleValue obj, PropType name, JS::HandleValue value, bool constant=false, bool enumerable=true) |
| Set the named property on the given object. More...
|
|
template<typename T , typename PropType > |
bool | SetProperty (const ScriptRequest &rq, JS::HandleValue obj, PropType name, const T &value, bool constant=false, bool enumerable=true) |
|
template<typename T > |
bool | SetPropertyInt (const ScriptRequest &rq, JS::HandleValue obj, int name, const T &value, bool constant=false, bool enumerable=true) |
|
template<typename T > |
bool | GetObjectClassName (const ScriptRequest &rq, JS::HandleObject obj, T &name) |
|
template<typename T > |
bool | GetObjectClassName (const ScriptRequest &rq, JS::HandleValue val, T &name) |
| Get the name of the object's class. More...
|
|
bool | FreezeObject (const ScriptRequest &rq, JS::HandleValue objVal, bool deep) |
|
bool | EnumeratePropertyNames (const ScriptRequest &rq, JS::HandleValue objVal, bool enumerableOnly, std::vector< std::string > &out) |
| Returns all properties of the object, both own properties and inherited. More...
|
|
JS::Value | CreateObject (const ScriptRequest &rq) |
| Create a plain object (i.e. More...
|
|
bool | CreateObject (const ScriptRequest &rq, JS::MutableHandleValue objectValue) |
|
template<typename T , typename... Args> |
bool | CreateObject (const ScriptRequest &rq, JS::MutableHandleValue objectValue, const char *propertyName, const T &propertyValue, Args const &... args) |
| Sets the given value to a new plain JS::Object, converts the arguments to JS::Values and sets them as properties. More...
|
|
bool | CreateArray (const ScriptRequest &rq, JS::MutableHandleValue objectValue, size_t length=0) |
| Sets the given value to a new JS object or Null Value in case of out-of-memory. More...
|
|
void | UnhandledRejectedPromise (JSContext *cx, bool, JS::HandleObject promise, JS::PromiseRejectionHandlingState state, void *) |
|
template<typename T > |
bool | FromJSVal (const ScriptRequest &rq, const JS::HandleValue val, T &ret) |
| Convert a JS::Value to a C++ type. More...
|
|
template<typename T > |
void | ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue ret, T const &val) |
| Convert a C++ type to a JS::Value. More...
|
|
template<> |
void | ToJSVal< JS::PersistentRootedValue > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::PersistentRootedValue &a) |
|
template<> |
void | ToJSVal< JS::Heap< JS::Value > > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::Heap< JS::Value > &a) |
|
template<> |
void | ToJSVal< JS::RootedValue > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::RootedValue &a) |
|
template<> |
void | ToJSVal< JS::HandleValue > (const ScriptRequest &rq, JS::MutableHandleValue handle, const JS::HandleValue &a) |
|
template<typename T > |
bool | FromJSProperty (const ScriptRequest &rq, const JS::HandleValue val, const char *name, T &ret, bool strict=false) |
| Convert a named property of an object to a C++ type. More...
|
|
template<typename T > |
void | ToJSVal_vector (const ScriptRequest &rq, JS::MutableHandleValue ret, const std::vector< T > &val) |
|
template<typename T > |
bool | FromJSVal_vector (const ScriptRequest &rq, JS::HandleValue v, std::vector< T > &out) |
|
StructuredClone | WriteStructuredClone (const ScriptRequest &rq, JS::HandleValue v) |
|
void | ReadStructuredClone (const ScriptRequest &rq, const StructuredClone &ptr, JS::MutableHandleValue ret) |
|
JS::Value | CloneValueFromOtherCompartment (const ScriptInterface &to, const ScriptInterface &from, JS::HandleValue val) |
| Construct a new value by cloning a value (possibly from a different Compartment). More...
|
|
JS::Value | DeepCopy (const ScriptRequest &rq, JS::HandleValue val) |
| Clone a JS value, ensuring that changes to the result won't affect the original value. More...
|
|
Wraps SM APIs for manipulating JS objects.