From 611dee39eb474f8fd5dd35e7b25fef7809fada7c Mon Sep 17 00:00:00 2001 From: cybai Date: Mon, 21 Feb 2022 00:16:18 +0900 Subject: [PATCH 1/2] Update SpiderMonkey to 97 --- Cargo.toml | 2 +- src/glue_wrappers.in | 11 +- src/jsapi_wrappers.in | 262 ++++++++++++++++++----------------- src/jsglue.cpp | 45 ++++-- src/lib.rs | 2 +- src/rust.rs | 10 +- tests/property_descriptor.rs | 68 +++++++-- 7 files changed, 229 insertions(+), 171 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2b660579d..8979f09f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,4 +60,4 @@ lazy_static = "1" libc = "0.2" log = "0.4" num-traits = "0.2" -mozjs_sys = { git = "https://github.com/servo/mozjs", rev="4cd3f5b81f4c363c039631bf870e61a00c983f63" } +mozjs_sys = { git = "https://github.com/CYBAI/mozjs", branch = "smup-97" } diff --git a/src/glue_wrappers.in b/src/glue_wrappers.in index fbed877ef..96f3d704d 100644 --- a/src/glue_wrappers.in +++ b/src/glue_wrappers.in @@ -1,11 +1,3 @@ -wrap!(glue: pub fn InvokeGetOwnPropertyDescriptor(handler: *const ::libc::c_void, cx: *mut JSContext, proxy: HandleObject, id: HandleId, desc: MutableHandle) -> bool); -wrap!(glue: pub fn InvokeHasOwn(handler: *const ::libc::c_void, cx: *mut JSContext, proxy: HandleObject, id: HandleId, bp: *mut bool) -> bool); -wrap!(glue: pub fn CallJitGetterOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); -wrap!(glue: pub fn CallJitSetterOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); -wrap!(glue: pub fn CallJitMethodOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); -wrap!(glue: pub fn NewProxyObject(aCx: *mut JSContext, aHandler: *const ::libc::c_void, aPriv: HandleValue, proto: *mut JSObject, classp: *const JSClass, aLazyProto: bool) -> *mut JSObject); -wrap!(glue: pub fn WrapperNew(aCx: *mut JSContext, aObj: HandleObject, aHandler: *const ::libc::c_void, aClass: *const JSClass, aSingleton: bool) -> *mut JSObject); -wrap!(glue: pub fn NewWindowProxy(aCx: *mut JSContext, aObj: HandleObject, aHandler: *const ::libc::c_void) -> *mut JSObject); wrap!(glue: pub fn RUST_JSID_IS_INT(id: HandleId) -> bool); wrap!(glue: pub fn RUST_JSID_TO_INT(id: HandleId) -> i32); wrap!(glue: pub fn int_to_jsid(i: i32, id: MutableHandleId)); @@ -13,9 +5,8 @@ wrap!(glue: pub fn RUST_JSID_IS_STRING(id: HandleId) -> bool); wrap!(glue: pub fn RUST_JSID_TO_STRING(id: HandleId) -> *mut JSString); wrap!(glue: pub fn RUST_SYMBOL_TO_JSID(sym: *mut Symbol, id: MutableHandleId)); wrap!(glue: pub fn RUST_JSID_IS_VOID(id: HandleId) -> bool); -wrap!(glue: pub fn RUST_INTERNED_STRING_TO_JSID(cx: *mut JSContext, str: *mut JSString, id: MutableHandleId)); 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_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))); diff --git a/src/jsapi_wrappers.in b/src/jsapi_wrappers.in index 29f29bb2f..0d9a51132 100644 --- a/src/jsapi_wrappers.in +++ b/src/jsapi_wrappers.in @@ -9,7 +9,6 @@ wrap!(jsapi: pub fn DateIsValid(cx: *mut JSContext, obj: HandleObject, isValid: wrap!(jsapi: pub fn DateGetMsecSinceEpoch(cx: *mut JSContext, obj: HandleObject, msecSinceEpoch: *mut f64) -> bool); wrap!(jsapi: pub fn PrepareScriptEnvironmentAndInvoke(cx: *mut JSContext, global: HandleObject, closure: *mut ScriptEnvironmentPreparer_Closure)); wrap!(jsapi: pub fn GetElementsWithAdder(cx: *mut JSContext, obj: HandleObject, receiver: HandleObject, begin: u32, end: u32, adder: *mut ElementAdder) -> bool); -wrap!(jsapi: pub fn SetPropertyIgnoringNamedGetter(cx: *mut JSContext, obj: HandleObject, id: HandleId, v: HandleValue, receiver: HandleValue, ownDesc: Handle, result: *mut ObjectOpResult) -> bool); wrap!(jsapi: pub fn ExecuteInFrameScriptEnvironment(cx: *mut JSContext, obj: HandleObject, script: HandleScript, scope: MutableHandleObject) -> bool); wrap!(jsapi: pub fn ReportIsNotFunction(cx: *mut JSContext, v: HandleValue) -> bool); wrap!(jsapi: pub fn RemapRemoteWindowProxies(cx: *mut JSContext, callback: *mut CompartmentTransplantCallback, newTarget: MutableHandleObject)); @@ -28,35 +27,18 @@ wrap!(jsapi: pub fn ToObjectSlow(cx: *mut JSContext, v: HandleValue, reportScanS wrap!(jsapi: pub fn NukeNonCCWProxy(cx: *mut JSContext, proxy: HandleObject)); wrap!(jsapi: pub fn GetFirstSubsumedSavedFrame(cx: *mut JSContext, principals: *mut JSPrincipals, savedFrame: HandleObject, selfHosted: SavedFrameSelfHosted) -> *mut JSObject); wrap!(jsapi: pub fn SetWindowProxy(cx: *mut JSContext, global: HandleObject, windowProxy: HandleObject)); +wrap!(jsapi: pub fn TransparentObjectWrapper(cx: *mut JSContext, existing: HandleObject, obj: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn UnwrapOneCheckedDynamic(obj: HandleObject, cx: *mut JSContext, stopAtWindowProxy: bool) -> *mut JSObject); +wrap!(jsapi: pub fn RemapDeadWrapper(cx: *mut JSContext, wobj: HandleObject, newTarget: HandleObject)); +wrap!(jsapi: pub fn RemapAllWrappersForObject(cx: *mut JSContext, oldTarget: HandleObject, newTarget: HandleObject) -> bool); wrap!(jsapi: pub fn ComputeThis(cx: *mut JSContext, vp: *mut Value, thisObject: MutableHandleObject) -> bool); wrap!(jsapi: pub fn GetFunctionRealm(cx: *mut JSContext, objArg: HandleObject) -> *mut Realm); -wrap!(jsapi: pub fn ObjectToCompletePropertyDescriptor(cx: *mut JSContext, obj: HandleObject, descriptor: Handle, desc: MutableHandle) -> bool); -wrap!(jsapi: pub fn FromPropertyDescriptor(cx: *mut JSContext, desc: Handle, vp: MutableHandle) -> bool); -wrap!(jsapi: pub fn NewSymbol(cx: *mut JSContext, description: Handle<*mut JSString>) -> *mut Symbol); -wrap!(jsapi: pub fn GetSymbolFor(cx: *mut JSContext, key: Handle<*mut JSString>) -> *mut Symbol); -wrap!(jsapi: pub fn GetSymbolDescription(symbol: Handle<*mut Symbol>) -> *mut JSString); -wrap!(jsapi: pub fn GetSymbolCode(symbol: Handle<*mut Symbol>) -> SymbolCode); -wrap!(jsapi: pub fn EncodeScript(cx: *mut JSContext, buffer: *mut TranscodeBuffer, script: Handle<*mut JSScript>) -> TranscodeResult); -wrap!(jsapi: pub fn DecodeScript(cx: *mut JSContext, options: *const ReadOnlyCompileOptions, buffer: *mut TranscodeBuffer, scriptp: MutableHandle<*mut JSScript>, cursorIndex: usize) -> TranscodeResult); -wrap!(jsapi: pub fn DecodeScript1(cx: *mut JSContext, options: *const ReadOnlyCompileOptions, range: *const TranscodeRange, scriptp: MutableHandle<*mut JSScript>) -> TranscodeResult); -wrap!(jsapi: pub fn DecodeScriptMaybeStencil(cx: *mut JSContext, options: *const ReadOnlyCompileOptions, buffer: *mut TranscodeBuffer, scriptp: MutableHandle<*mut JSScript>, cursorIndex: usize) -> TranscodeResult); -wrap!(jsapi: pub fn DecodeScriptAndStartIncrementalEncoding(cx: *mut JSContext, options: *const ReadOnlyCompileOptions, buffer: *mut TranscodeBuffer, scriptp: MutableHandle<*mut JSScript>, cursorIndex: usize) -> TranscodeResult); -wrap!(jsapi: pub fn FinishIncrementalEncoding(cx: *mut JSContext, script: Handle<*mut JSScript>, buffer: *mut TranscodeBuffer) -> bool); -wrap!(jsapi: pub fn ProtoKeyToId(cx: *mut JSContext, key: JSProtoKey, idp: MutableHandleId)); -wrap!(jsapi: pub fn ToPrimitive(cx: *mut JSContext, obj: HandleObject, hint: JSType, vp: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, v: HandleValue, bp: *mut bool) -> bool); -wrap!(jsapi: pub fn InstanceofOperator(cx: *mut JSContext, obj: HandleObject, v: HandleValue, bp: *mut bool) -> bool); -wrap!(jsapi: pub fn Call(cx: *mut JSContext, thisv: HandleValue, fun: HandleValue, args: *const HandleValueArray, rval: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn Construct(cx: *mut JSContext, fun: HandleValue, newTarget: HandleObject, args: *const HandleValueArray, objp: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn Construct1(cx: *mut JSContext, fun: HandleValue, args: *const HandleValueArray, objp: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn IsMapObject(cx: *mut JSContext, obj: HandleObject, isMap: *mut bool) -> bool); -wrap!(jsapi: pub fn IsSetObject(cx: *mut JSContext, obj: HandleObject, isSet: *mut bool) -> bool); -wrap!(jsapi: pub fn GetSelfHostedFunction(cx: *mut JSContext, selfHostedName: *const ::std::os::raw::c_char, id: HandleId, nargs: ::std::os::raw::c_uint) -> *mut JSFunction); -wrap!(jsapi: pub fn NewFunctionFromSpec(cx: *mut JSContext, fs: *const JSFunctionSpec, id: HandleId) -> *mut JSFunction); -wrap!(jsapi: pub fn PropertySpecNameEqualsId(name: JSPropertySpec_Name, id: HandleId) -> bool); +wrap!(jsapi: pub fn Call(cx: *mut JSContext, thisv: Handle, fun: Handle, args: *const HandleValueArray, rval: MutableHandle) -> bool); +wrap!(jsapi: pub fn Construct(cx: *mut JSContext, fun: Handle, newTarget: HandleObject, args: *const HandleValueArray, objp: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn Construct1(cx: *mut JSContext, fun: Handle, args: *const HandleValueArray, objp: MutableHandleObject) -> bool); +// wrap!(jsapi: pub fn GetDebuggeeGlobals(cx: *mut JSContext, dbgObj: *mut JSObject, vector: MutableHandleObjectVector) -> bool); wrap!(jsapi: pub fn CreateError(cx: *mut JSContext, type_: JSExnType, stack: HandleObject, fileName: HandleString, lineNumber: u32, columnNumber: u32, report: *mut JSErrorReport, message: HandleString, rval: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn GetWeakMapEntry(cx: *mut JSContext, mapObj: HandleObject, key: HandleObject, val: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn SetWeakMapEntry(cx: *mut JSContext, mapObj: HandleObject, key: HandleObject, val: HandleValue) -> bool); +wrap!(jsapi: pub fn ExceptionStackOrNull(obj: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn MapSize(cx: *mut JSContext, obj: HandleObject) -> u32); wrap!(jsapi: pub fn MapGet(cx: *mut JSContext, obj: HandleObject, key: HandleValue, rval: MutableHandleValue) -> bool); wrap!(jsapi: pub fn MapHas(cx: *mut JSContext, obj: HandleObject, key: HandleValue, rval: *mut bool) -> bool); @@ -76,16 +58,33 @@ wrap!(jsapi: pub fn SetKeys(cx: *mut JSContext, obj: HandleObject, rval: Mutable wrap!(jsapi: pub fn SetValues(cx: *mut JSContext, obj: HandleObject, rval: MutableHandleValue) -> bool); wrap!(jsapi: pub fn SetEntries(cx: *mut JSContext, obj: HandleObject, rval: MutableHandleValue) -> bool); wrap!(jsapi: pub fn SetForEach(cx: *mut JSContext, obj: HandleObject, callbackFn: HandleValue, thisVal: HandleValue) -> bool); -wrap!(jsapi: pub fn ExceptionStackOrNull(obj: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn ObjectToCompletePropertyDescriptor(cx: *mut JSContext, obj: HandleObject, descriptor: Handle, desc: MutableHandle) -> bool); +wrap!(jsapi: pub fn NewSymbol(cx: *mut JSContext, description: Handle<*mut JSString>) -> *mut Symbol); +wrap!(jsapi: pub fn GetSymbolFor(cx: *mut JSContext, key: Handle<*mut JSString>) -> *mut Symbol); +wrap!(jsapi: pub fn GetSymbolDescription(symbol: Handle<*mut Symbol>) -> *mut JSString); +wrap!(jsapi: pub fn GetSymbolCode(symbol: Handle<*mut Symbol>) -> SymbolCode); wrap!(jsapi: pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, capture: *mut StackCapture) -> bool); wrap!(jsapi: pub fn BuildStackString(cx: *mut JSContext, principals: *mut JSPrincipals, stack: HandleObject, stringp: MutableHandleString, indent: usize, stackFormat: StackFormat) -> bool); +wrap!(jsapi: pub fn FinishIncrementalEncoding(cx: *mut JSContext, script: Handle<*mut JSScript>, buffer: *mut TranscodeBuffer) -> bool); +wrap!(jsapi: pub fn GetWeakMapEntry(cx: *mut JSContext, mapObj: HandleObject, key: HandleObject, val: MutableHandleValue) -> bool); +wrap!(jsapi: pub fn SetWeakMapEntry(cx: *mut JSContext, mapObj: HandleObject, key: HandleObject, val: HandleValue) -> bool); +wrap!(jsapi: pub fn ProtoKeyToId(cx: *mut JSContext, key: JSProtoKey, idp: MutableHandleId)); +wrap!(jsapi: pub fn ToPrimitive(cx: *mut JSContext, obj: HandleObject, hint: JSType, vp: MutableHandleValue) -> bool); +wrap!(jsapi: pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, v: HandleValue, bp: *mut bool) -> bool); +wrap!(jsapi: pub fn InstanceofOperator(cx: *mut JSContext, obj: HandleObject, v: HandleValue, bp: *mut bool) -> bool); +wrap!(jsapi: pub fn IsMapObject(cx: *mut JSContext, obj: HandleObject, isMap: *mut bool) -> bool); +wrap!(jsapi: pub fn IsSetObject(cx: *mut JSContext, obj: HandleObject, isSet: *mut bool) -> bool); +wrap!(jsapi: pub fn GetSelfHostedFunction(cx: *mut JSContext, selfHostedName: *const ::std::os::raw::c_char, id: HandleId, nargs: ::std::os::raw::c_uint) -> *mut JSFunction); +wrap!(jsapi: pub fn NewFunctionFromSpec(cx: *mut JSContext, fs: *const JSFunctionSpec, id: HandleId) -> *mut JSFunction); +wrap!(jsapi: pub fn PropertySpecNameEqualsId(name: JSPropertySpec_Name, id: HandleId) -> bool); wrap!(jsapi: pub fn GetBuiltinClass(cx: *mut JSContext, obj: HandleObject, cls: *mut ESClass) -> bool); wrap!(jsapi: pub fn ForceLexicalInitialization(cx: *mut JSContext, obj: HandleObject) -> bool); wrap!(jsapi: pub fn CopyArrayBuffer(cx: *mut JSContext, maybeArrayBuffer: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn DetachArrayBuffer(cx: *mut JSContext, obj: HandleObject) -> bool); +wrap!(jsapi: pub fn HasDefinedArrayBufferDetachKey(cx: *mut JSContext, obj: HandleObject, isDefined: *mut bool) -> bool); wrap!(jsapi: pub fn StealArrayBufferContents(cx: *mut JSContext, obj: HandleObject) -> *mut ::std::os::raw::c_void); -wrap!(jsapi: pub fn CloneAndExecuteScript(cx: *mut JSContext, script: Handle<*mut JSScript>, rval: MutableHandle) -> bool); -wrap!(jsapi: pub fn CloneAndExecuteScript1(cx: *mut JSContext, envChain: HandleObjectVector, script: Handle<*mut JSScript>, rval: MutableHandle) -> bool); +wrap!(jsapi: pub fn ArrayBufferCopyData(cx: *mut JSContext, toBlock: HandleObject, toIndex: usize, fromBlock: HandleObject, fromIndex: usize, count: usize) -> bool); +wrap!(jsapi: pub fn ArrayBufferClone(cx: *mut JSContext, srcBuffer: HandleObject, srcByteOffset: usize, srcLength: usize) -> *mut JSObject); wrap!(jsapi: pub fn Evaluate(cx: *mut JSContext, options: *const ReadOnlyCompileOptions, srcBuf: *mut SourceText, rval: MutableHandle) -> bool); wrap!(jsapi: pub fn Evaluate1(cx: *mut JSContext, envChain: HandleObjectVector, options: *const ReadOnlyCompileOptions, srcBuf: *mut SourceText, rval: MutableHandle) -> bool); wrap!(jsapi: pub fn Evaluate2(cx: *mut JSContext, options: *const ReadOnlyCompileOptions, srcBuf: *mut SourceText, rval: MutableHandle) -> bool); @@ -94,6 +93,7 @@ wrap!(jsapi: pub fn CompileFunction(cx: *mut JSContext, envChain: HandleObjectVe wrap!(jsapi: pub fn CompileFunction1(cx: *mut JSContext, envChain: HandleObjectVector, options: *const ReadOnlyCompileOptions, name: *const ::std::os::raw::c_char, nargs: ::std::os::raw::c_uint, argnames: *const *const ::std::os::raw::c_char, srcBuf: *mut SourceText) -> *mut JSFunction); wrap!(jsapi: pub fn CompileFunctionUtf8(cx: *mut JSContext, envChain: HandleObjectVector, options: *const ReadOnlyCompileOptions, name: *const ::std::os::raw::c_char, nargs: ::std::os::raw::c_uint, argnames: *const *const ::std::os::raw::c_char, utf8: *const ::std::os::raw::c_char, length: usize) -> *mut JSFunction); wrap!(jsapi: pub fn ExposeScriptToDebugger(cx: *mut JSContext, script: Handle<*mut JSScript>)); +wrap!(jsapi: pub fn UpdateDebugMetadata(cx: *mut JSContext, script: Handle<*mut JSScript>, options: *const InstantiateOptions, privateValue: HandleValue, elementAttributeName: HandleString, introScript: HandleScript, scriptOrModule: HandleScript) -> bool); wrap!(jsapi: pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool); wrap!(jsapi: pub fn ObjectIsDate(cx: *mut JSContext, obj: HandleObject, isDate: *mut bool) -> bool); wrap!(jsapi: pub fn StrictlyEqual(cx: *mut JSContext, v1: Handle, v2: Handle, equal: *mut bool) -> bool); @@ -101,8 +101,8 @@ wrap!(jsapi: pub fn LooselyEqual(cx: *mut JSContext, v1: Handle, v2: Hand wrap!(jsapi: pub fn SameValue(cx: *mut JSContext, v1: Handle, v2: Handle, same: *mut bool) -> bool); wrap!(jsapi: pub fn ToJSONMaybeSafely(cx: *mut JSContext, input: HandleObject, callback: JSONWriteCallback, data: *mut ::std::os::raw::c_void) -> bool); wrap!(jsapi: pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool); -wrap!(jsapi: pub fn FinishDynamicModuleImport(cx: *mut JSContext, evaluationPromise: HandleObject, referencingPrivate: Handle, specifier: Handle<*mut JSString>, promise: HandleObject) -> bool); -wrap!(jsapi: pub fn FinishDynamicModuleImport_NoTLA(cx: *mut JSContext, status: DynamicImportStatus, referencingPrivate: Handle, specifier: Handle<*mut JSString>, promise: HandleObject) -> bool); +wrap!(jsapi: pub fn FinishDynamicModuleImport(cx: *mut JSContext, evaluationPromise: HandleObject, referencingPrivate: Handle, moduleRequest: HandleObject, promise: HandleObject) -> bool); +wrap!(jsapi: pub fn FinishDynamicModuleImport_NoTLA(cx: *mut JSContext, status: DynamicImportStatus, referencingPrivate: Handle, moduleRequest: HandleObject, promise: HandleObject) -> bool); wrap!(jsapi: pub fn ModuleInstantiate(cx: *mut JSContext, moduleRecord: HandleObject) -> bool); wrap!(jsapi: pub fn ModuleEvaluate(cx: *mut JSContext, moduleRecord: HandleObject, rval: MutableHandleValue) -> bool); wrap!(jsapi: pub fn ThrowOnModuleEvaluationFailure(cx: *mut JSContext, evaluationPromise: HandleObject) -> bool); @@ -110,6 +110,8 @@ wrap!(jsapi: pub fn GetRequestedModules(cx: *mut JSContext, moduleRecord: Handle wrap!(jsapi: pub fn GetRequestedModuleSpecifier(cx: *mut JSContext, requestedModuleObject: Handle) -> *mut JSString); wrap!(jsapi: pub fn GetRequestedModuleSourcePos(cx: *mut JSContext, requestedModuleObject: Handle, lineNumber: *mut u32, columnNumber: *mut u32)); wrap!(jsapi: pub fn GetModuleScript(moduleRecord: HandleObject) -> *mut JSScript); +wrap!(jsapi: pub fn CreateModuleRequest(cx: *mut JSContext, specifierArg: Handle<*mut JSString>) -> *mut JSObject); +wrap!(jsapi: pub fn GetModuleRequestSpecifier(cx: *mut JSContext, moduleRequestArg: HandleObject) -> *mut JSString); wrap!(jsapi: pub fn NewPromiseObject(cx: *mut JSContext, executor: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn IsPromiseObject(obj: HandleObject) -> bool); wrap!(jsapi: pub fn GetPromiseState(promise: HandleObject) -> PromiseState); @@ -138,7 +140,7 @@ wrap!(jsapi: pub fn IsArray(cx: *mut JSContext, obj: HandleObject, isArray: *mut wrap!(jsapi: pub fn IsArray1(cx: *mut JSContext, obj: HandleObject, answer: *mut IsArrayAnswer) -> bool); wrap!(jsapi: pub fn SetRegExpInput(cx: *mut JSContext, obj: HandleObject, input: Handle<*mut JSString>) -> bool); wrap!(jsapi: pub fn ClearRegExpStatics(cx: *mut JSContext, obj: HandleObject) -> bool); -wrap!(jsapi: pub fn ExecuteRegExp(cx: *mut JSContext, obj: HandleObject, reobj: HandleObject, chars: *mut u16, length: usize, indexp: *mut usize, test: bool, rval: MutableHandle) -> bool); +wrap!(jsapi: pub fn ExecuteRegExp(cx: *mut JSContext, obj: HandleObject, reobj: HandleObject, chars: *const u16, length: usize, indexp: *mut usize, test: bool, rval: MutableHandle) -> bool); wrap!(jsapi: pub fn ExecuteRegExpNoStatics(cx: *mut JSContext, reobj: HandleObject, chars: *const u16, length: usize, indexp: *mut usize, test: bool, rval: MutableHandle) -> bool); wrap!(jsapi: pub fn ObjectIsRegExp(cx: *mut JSContext, obj: HandleObject, isRegExp: *mut bool) -> bool); wrap!(jsapi: pub fn GetRegExpFlags(cx: *mut JSContext, obj: HandleObject) -> RegExpFlags); @@ -174,142 +176,134 @@ wrap!(jsapi: pub fn ReadableStreamReaderReleaseLock(cx: *mut JSContext, reader: wrap!(jsapi: pub fn ReadableStreamDefaultReaderRead(cx: *mut JSContext, reader: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn IsWasmModuleObject(obj: HandleObject) -> bool); wrap!(jsapi: pub fn GetWasmModule(obj: HandleObject) -> RefPtr); -wrap!(jsapi: pub fn JS_EncodeStringToUTF8(cx: *mut JSContext, str: Handle<*mut JSString>) -> UniqueChars); -wrap!(jsapi: pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, objp: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn JS_ValueToFunction(cx: *mut JSContext, v: HandleValue) -> *mut JSFunction); -wrap!(jsapi: pub fn JS_ValueToConstructor(cx: *mut JSContext, v: HandleValue) -> *mut JSFunction); -wrap!(jsapi: pub fn JS_ValueToSource(cx: *mut JSContext, v: Handle) -> *mut JSString); -wrap!(jsapi: pub fn JS_TypeOfValue(cx: *mut JSContext, v: Handle) -> JSType); -wrap!(jsapi: pub fn JS_WrapObject(cx: *mut JSContext, objp: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn JS_WrapValue(cx: *mut JSContext, vp: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn JS_TransplantObject(cx: *mut JSContext, origobj: HandleObject, target: HandleObject) -> *mut JSObject); -wrap!(jsapi: pub fn JS_RefreshCrossCompartmentWrappers(cx: *mut JSContext, obj: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_ResolveStandardClass(cx: *mut JSContext, obj: HandleObject, id: HandleId, resolved: *mut bool) -> bool); -wrap!(jsapi: pub fn JS_EnumerateStandardClasses(cx: *mut JSContext, obj: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_NewEnumerateStandardClasses(cx: *mut JSContext, obj: HandleObject, properties: MutableHandleIdVector, enumerableOnly: bool) -> bool); -wrap!(jsapi: pub fn JS_NewEnumerateStandardClassesIncludingResolved(cx: *mut JSContext, obj: HandleObject, properties: MutableHandleIdVector, enumerableOnly: bool) -> bool); -wrap!(jsapi: pub fn JS_GetClassObject(cx: *mut JSContext, key: JSProtoKey, objp: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn JS_GetClassPrototype(cx: *mut JSContext, key: JSProtoKey, objp: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn JS_IdToProtoKey(cx: *mut JSContext, id: HandleId) -> JSProtoKey); -wrap!(jsapi: pub fn JS_InitReflectParse(cx: *mut JSContext, global: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_DefineProfilingFunctions(cx: *mut JSContext, obj: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_CallFunctionValue(cx: *mut JSContext, obj: HandleObject, fval: Handle, args: *const HandleValueArray, rval: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_CallFunction(cx: *mut JSContext, obj: HandleObject, fun: Handle<*mut JSFunction>, args: *const HandleValueArray, rval: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_CallFunctionName(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, args: *const HandleValueArray, rval: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_EncodeStringToUTF8(cx: *mut JSContext, str_: Handle<*mut JSString>) -> UniqueChars); wrap!(jsapi: pub fn JS_DefineDebuggerObject(cx: *mut JSContext, obj: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_ValueToId(cx: *mut JSContext, v: HandleValue, idp: MutableHandleId) -> bool); -wrap!(jsapi: pub fn JS_StringToId(cx: *mut JSContext, s: HandleString, idp: MutableHandleId) -> bool); -wrap!(jsapi: pub fn JS_IdToValue(cx: *mut JSContext, id: jsid, vp: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_InitClass(cx: *mut JSContext, obj: HandleObject, parent_proto: HandleObject, clasp: *const JSClass, constructor: JSNative, nargs: ::std::os::raw::c_uint, ps: *const JSPropertySpec, fs: *const JSFunctionSpec, static_ps: *const JSPropertySpec, static_fs: *const JSFunctionSpec) -> *mut JSObject); -wrap!(jsapi: pub fn JS_LinkConstructorAndPrototype(cx: *mut JSContext, ctor: HandleObject, proto: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_InstanceOf(cx: *mut JSContext, obj: HandleObject, clasp: *const JSClass, args: *mut CallArgs) -> bool); -wrap!(jsapi: pub fn JS_HasInstance(cx: *mut JSContext, obj: HandleObject, v: Handle, bp: *mut bool) -> bool); -wrap!(jsapi: pub fn JS_GetInstancePrivate(cx: *mut JSContext, obj: HandleObject, clasp: *const JSClass, args: *mut CallArgs) -> *mut ::std::os::raw::c_void); -wrap!(jsapi: pub fn JS_GetConstructor(cx: *mut JSContext, proto: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_GetPendingException(cx: *mut JSContext, vp: MutableHandleValue) -> bool); +wrap!(jsapi: pub fn JS_SetPendingException(cx: *mut JSContext, v: HandleValue, behavior: ExceptionStackBehavior)); +wrap!(jsapi: pub fn JS_ErrorFromException(cx: *mut JSContext, obj: HandleObject) -> *mut JSErrorReport); wrap!(jsapi: pub fn JS_FireOnNewGlobalObject(cx: *mut JSContext, global: HandleObject)); -wrap!(jsapi: pub fn JS_NewObjectWithGivenProto(cx: *mut JSContext, clasp: *const JSClass, proto: HandleObject) -> *mut JSObject); -wrap!(jsapi: pub fn JS_DeepFreezeObject(cx: *mut JSContext, obj: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_FreezeObject(cx: *mut JSContext, obj: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_GetPrototype(cx: *mut JSContext, obj: HandleObject, result: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn JS_GetPrototypeIfOrdinary(cx: *mut JSContext, obj: HandleObject, isOrdinary: *mut bool, result: MutableHandleObject) -> bool); -wrap!(jsapi: pub fn JS_SetPrototype(cx: *mut JSContext, obj: HandleObject, proto: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_IsExtensible(cx: *mut JSContext, obj: HandleObject, extensible: *mut bool) -> bool); -wrap!(jsapi: pub fn JS_PreventExtensions(cx: *mut JSContext, obj: HandleObject, result: *mut ObjectOpResult) -> bool); -wrap!(jsapi: pub fn JS_SetImmutablePrototype(cx: *mut JSContext, obj: HandleObject, succeeded: *mut bool) -> bool); -wrap!(jsapi: pub fn JS_GetOwnPropertyDescriptorById(cx: *mut JSContext, obj: HandleObject, id: HandleId, desc: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_GetOwnPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, desc: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_GetOwnUCPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, desc: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_GetPropertyDescriptorById(cx: *mut JSContext, obj: HandleObject, id: HandleId, desc: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_GetPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, desc: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_GetUCPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, desc: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById(cx: *mut JSContext, obj: HandleObject, id: HandleId, desc: Handle, result: *mut ObjectOpResult) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById1(cx: *mut JSContext, obj: HandleObject, id: HandleId, desc: Handle) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById2(cx: *mut JSContext, obj: HandleObject, id: HandleId, value: HandleValue, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById3(cx: *mut JSContext, obj: HandleObject, id: HandleId, getter: JSNative, setter: JSNative, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById4(cx: *mut JSContext, obj: HandleObject, id: HandleId, getter: HandleObject, setter: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById5(cx: *mut JSContext, obj: HandleObject, id: HandleId, value: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById6(cx: *mut JSContext, obj: HandleObject, id: HandleId, value: HandleString, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById7(cx: *mut JSContext, obj: HandleObject, id: HandleId, value: i32, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById8(cx: *mut JSContext, obj: HandleObject, id: HandleId, value: u32, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefinePropertyById9(cx: *mut JSContext, obj: HandleObject, id: HandleId, value: f64, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefineProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: HandleValue, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById(cx: *mut JSContext, obj: HandleObject, id: Handle, desc: Handle, result: *mut ObjectOpResult) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById1(cx: *mut JSContext, obj: HandleObject, id: Handle, desc: Handle) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById2(cx: *mut JSContext, obj: HandleObject, id: Handle, value: Handle, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById3(cx: *mut JSContext, obj: HandleObject, id: Handle, getter: JSNative, setter: JSNative, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById4(cx: *mut JSContext, obj: HandleObject, id: Handle, getter: HandleObject, setter: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById5(cx: *mut JSContext, obj: HandleObject, id: Handle, value: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById6(cx: *mut JSContext, obj: HandleObject, id: Handle, value: Handle<*mut JSString>, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById7(cx: *mut JSContext, obj: HandleObject, id: Handle, value: i32, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById8(cx: *mut JSContext, obj: HandleObject, id: Handle, value: u32, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefinePropertyById9(cx: *mut JSContext, obj: HandleObject, id: Handle, value: f64, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefineProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: Handle, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineProperty1(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, getter: JSNative, setter: JSNative, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineProperty2(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, getter: HandleObject, setter: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineProperty3(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefineProperty4(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: HandleString, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefineProperty4(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: Handle<*mut JSString>, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineProperty5(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: i32, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineProperty6(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: u32, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineProperty7(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, value: f64, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineUCProperty(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, desc: Handle, result: *mut ObjectOpResult) -> bool); wrap!(jsapi: pub fn JS_DefineUCProperty1(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, desc: Handle) -> bool); -wrap!(jsapi: pub fn JS_DefineUCProperty2(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: HandleValue, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefineUCProperty2(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: Handle, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineUCProperty3(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, getter: HandleObject, setter: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineUCProperty4(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefineUCProperty5(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: HandleString, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefineUCProperty5(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: Handle<*mut JSString>, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineUCProperty6(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: i32, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineUCProperty7(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: u32, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineUCProperty8(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, value: f64, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefineElement(cx: *mut JSContext, obj: HandleObject, index: u32, value: HandleValue, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefineElement(cx: *mut JSContext, obj: HandleObject, index: u32, value: Handle, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineElement1(cx: *mut JSContext, obj: HandleObject, index: u32, getter: HandleObject, setter: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineElement2(cx: *mut JSContext, obj: HandleObject, index: u32, value: HandleObject, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_DefineElement3(cx: *mut JSContext, obj: HandleObject, index: u32, value: HandleString, attrs: ::std::os::raw::c_uint) -> bool); +wrap!(jsapi: pub fn JS_DefineElement3(cx: *mut JSContext, obj: HandleObject, index: u32, value: Handle<*mut JSString>, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineElement4(cx: *mut JSContext, obj: HandleObject, index: u32, value: i32, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineElement5(cx: *mut JSContext, obj: HandleObject, index: u32, value: u32, attrs: ::std::os::raw::c_uint) -> bool); wrap!(jsapi: pub fn JS_DefineElement6(cx: *mut JSContext, obj: HandleObject, index: u32, value: f64, attrs: ::std::os::raw::c_uint) -> bool); -wrap!(jsapi: pub fn JS_HasPropertyById(cx: *mut JSContext, obj: HandleObject, id: HandleId, foundp: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_HasPropertyById(cx: *mut JSContext, obj: HandleObject, id: Handle, foundp: *mut bool) -> bool); wrap!(jsapi: pub fn JS_HasProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, foundp: *mut bool) -> bool); wrap!(jsapi: pub fn JS_HasUCProperty(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, vp: *mut bool) -> bool); wrap!(jsapi: pub fn JS_HasElement(cx: *mut JSContext, obj: HandleObject, index: u32, foundp: *mut bool) -> bool); -wrap!(jsapi: pub fn JS_HasOwnPropertyById(cx: *mut JSContext, obj: HandleObject, id: HandleId, foundp: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_HasOwnPropertyById(cx: *mut JSContext, obj: HandleObject, id: Handle, foundp: *mut bool) -> bool); wrap!(jsapi: pub fn JS_HasOwnProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, foundp: *mut bool) -> bool); -wrap!(jsapi: pub fn JS_ForwardGetPropertyTo(cx: *mut JSContext, obj: HandleObject, id: HandleId, receiver: HandleValue, vp: MutableHandleValue) -> bool); +wrap!(jsapi: pub fn JS_ForwardGetPropertyTo(cx: *mut JSContext, obj: HandleObject, id: Handle, receiver: Handle, vp: MutableHandleValue) -> bool); wrap!(jsapi: pub fn JS_ForwardGetElementTo(cx: *mut JSContext, obj: HandleObject, index: u32, receiver: HandleObject, vp: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn JS_GetPropertyById(cx: *mut JSContext, obj: HandleObject, id: HandleId, vp: MutableHandleValue) -> bool); +wrap!(jsapi: pub fn JS_GetPropertyById(cx: *mut JSContext, obj: HandleObject, id: Handle, vp: MutableHandleValue) -> bool); wrap!(jsapi: pub fn JS_GetProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, vp: MutableHandleValue) -> bool); wrap!(jsapi: pub fn JS_GetUCProperty(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, vp: MutableHandleValue) -> bool); wrap!(jsapi: pub fn JS_GetElement(cx: *mut JSContext, obj: HandleObject, index: u32, vp: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn JS_ForwardSetPropertyTo(cx: *mut JSContext, obj: HandleObject, id: HandleId, v: HandleValue, receiver: HandleValue, result: *mut ObjectOpResult) -> bool); -wrap!(jsapi: pub fn JS_SetPropertyById(cx: *mut JSContext, obj: HandleObject, id: HandleId, v: HandleValue) -> bool); -wrap!(jsapi: pub fn JS_SetProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, v: HandleValue) -> bool); -wrap!(jsapi: pub fn JS_SetUCProperty(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, v: HandleValue) -> bool); -wrap!(jsapi: pub fn JS_SetElement(cx: *mut JSContext, obj: HandleObject, index: u32, v: HandleValue) -> bool); +wrap!(jsapi: pub fn JS_ForwardSetPropertyTo(cx: *mut JSContext, obj: HandleObject, id: Handle, v: Handle, receiver: Handle, result: *mut ObjectOpResult) -> bool); +wrap!(jsapi: pub fn JS_SetPropertyById(cx: *mut JSContext, obj: HandleObject, id: Handle, v: Handle) -> bool); +wrap!(jsapi: pub fn JS_SetProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, v: Handle) -> bool); +wrap!(jsapi: pub fn JS_SetUCProperty(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, v: Handle) -> bool); +wrap!(jsapi: pub fn JS_SetElement(cx: *mut JSContext, obj: HandleObject, index: u32, v: Handle) -> bool); wrap!(jsapi: pub fn JS_SetElement1(cx: *mut JSContext, obj: HandleObject, index: u32, v: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_SetElement2(cx: *mut JSContext, obj: HandleObject, index: u32, v: HandleString) -> bool); +wrap!(jsapi: pub fn JS_SetElement2(cx: *mut JSContext, obj: HandleObject, index: u32, v: Handle<*mut JSString>) -> bool); wrap!(jsapi: pub fn JS_SetElement3(cx: *mut JSContext, obj: HandleObject, index: u32, v: i32) -> bool); wrap!(jsapi: pub fn JS_SetElement4(cx: *mut JSContext, obj: HandleObject, index: u32, v: u32) -> bool); wrap!(jsapi: pub fn JS_SetElement5(cx: *mut JSContext, obj: HandleObject, index: u32, v: f64) -> bool); -wrap!(jsapi: pub fn JS_DeletePropertyById(cx: *mut JSContext, obj: HandleObject, id: HandleId, result: *mut ObjectOpResult) -> bool); +wrap!(jsapi: pub fn JS_DeletePropertyById(cx: *mut JSContext, obj: HandleObject, id: Handle, result: *mut ObjectOpResult) -> bool); wrap!(jsapi: pub fn JS_DeleteProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, result: *mut ObjectOpResult) -> bool); wrap!(jsapi: pub fn JS_DeleteUCProperty(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, result: *mut ObjectOpResult) -> bool); wrap!(jsapi: pub fn JS_DeleteElement(cx: *mut JSContext, obj: HandleObject, index: u32, result: *mut ObjectOpResult) -> bool); wrap!(jsapi: pub fn JS_DeletePropertyById1(cx: *mut JSContext, obj: HandleObject, id: jsid) -> bool); wrap!(jsapi: pub fn JS_DeleteProperty1(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char) -> bool); wrap!(jsapi: pub fn JS_DeleteElement1(cx: *mut JSContext, obj: HandleObject, index: u32) -> bool); -wrap!(jsapi: pub fn JS_AssignObject(cx: *mut JSContext, target: HandleObject, src: HandleObject) -> bool); -wrap!(jsapi: pub fn JS_CallFunctionValue(cx: *mut JSContext, obj: HandleObject, fval: HandleValue, args: *const HandleValueArray, rval: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn JS_CallFunction(cx: *mut JSContext, obj: HandleObject, fun: HandleFunction, args: *const HandleValueArray, rval: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn JS_CallFunctionName(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, args: *const HandleValueArray, rval: MutableHandleValue) -> bool); wrap!(jsapi: pub fn JS_DefineObject(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, clasp: *const JSClass, attrs: ::std::os::raw::c_uint) -> *mut JSObject); wrap!(jsapi: pub fn JS_DefineProperties(cx: *mut JSContext, obj: HandleObject, ps: *const JSPropertySpec) -> bool); -wrap!(jsapi: pub fn JS_AlreadyHasOwnPropertyById(cx: *mut JSContext, obj: HandleObject, id: HandleId, foundp: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_AlreadyHasOwnPropertyById(cx: *mut JSContext, obj: HandleObject, id: Handle, foundp: *mut bool) -> bool); wrap!(jsapi: pub fn JS_AlreadyHasOwnProperty(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, foundp: *mut bool) -> bool); wrap!(jsapi: pub fn JS_AlreadyHasOwnUCProperty(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, foundp: *mut bool) -> bool); wrap!(jsapi: pub fn JS_AlreadyHasOwnElement(cx: *mut JSContext, obj: HandleObject, index: u32, foundp: *mut bool) -> bool); -wrap!(jsapi: pub fn JS_SetAllNonReservedSlotsToUndefined(obj: HandleObject)); -wrap!(jsapi: pub fn JS_GetFunctionLength(cx: *mut JSContext, fun: HandleFunction, length: *mut u16) -> bool); wrap!(jsapi: pub fn JS_DefineFunctions(cx: *mut JSContext, obj: HandleObject, fs: *const JSFunctionSpec) -> bool); wrap!(jsapi: pub fn JS_DefineFunction(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, call: JSNative, nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction); wrap!(jsapi: pub fn JS_DefineUCFunction(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, call: JSNative, nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction); wrap!(jsapi: pub fn JS_DefineFunctionById(cx: *mut JSContext, obj: HandleObject, id: Handle, call: JSNative, nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction); +wrap!(jsapi: pub fn JS_NewDependentString(cx: *mut JSContext, str_: Handle<*mut JSString>, start: usize, length: usize) -> *mut JSString); +wrap!(jsapi: pub fn JS_ConcatStrings(cx: *mut JSContext, left: Handle<*mut JSString>, right: Handle<*mut JSString>) -> *mut JSString); +wrap!(jsapi: pub fn JS_RefreshCrossCompartmentWrappers(cx: *mut JSContext, obj: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, objp: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_ValueToFunction(cx: *mut JSContext, v: HandleValue) -> *mut JSFunction); +wrap!(jsapi: pub fn JS_ValueToConstructor(cx: *mut JSContext, v: HandleValue) -> *mut JSFunction); +wrap!(jsapi: pub fn JS_ValueToSource(cx: *mut JSContext, v: Handle) -> *mut JSString); +wrap!(jsapi: pub fn JS_TypeOfValue(cx: *mut JSContext, v: Handle) -> JSType); +wrap!(jsapi: pub fn JS_WrapObject(cx: *mut JSContext, objp: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_WrapValue(cx: *mut JSContext, vp: MutableHandleValue) -> bool); +wrap!(jsapi: pub fn JS_TransplantObject(cx: *mut JSContext, origobj: HandleObject, target: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_ResolveStandardClass(cx: *mut JSContext, obj: HandleObject, id: HandleId, resolved: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_EnumerateStandardClasses(cx: *mut JSContext, obj: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_NewEnumerateStandardClasses(cx: *mut JSContext, obj: HandleObject, properties: MutableHandleIdVector, enumerableOnly: bool) -> bool); +wrap!(jsapi: pub fn JS_NewEnumerateStandardClassesIncludingResolved(cx: *mut JSContext, obj: HandleObject, properties: MutableHandleIdVector, enumerableOnly: bool) -> bool); +wrap!(jsapi: pub fn JS_GetClassObject(cx: *mut JSContext, key: JSProtoKey, objp: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_GetClassPrototype(cx: *mut JSContext, key: JSProtoKey, objp: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_IdToProtoKey(cx: *mut JSContext, id: HandleId) -> JSProtoKey); +wrap!(jsapi: pub fn JS_InitReflectParse(cx: *mut JSContext, global: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_DefineProfilingFunctions(cx: *mut JSContext, obj: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_ValueToId(cx: *mut JSContext, v: HandleValue, idp: MutableHandleId) -> bool); +wrap!(jsapi: pub fn JS_StringToId(cx: *mut JSContext, s: HandleString, idp: MutableHandleId) -> bool); +wrap!(jsapi: pub fn JS_IdToValue(cx: *mut JSContext, id: jsid, vp: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_InitClass(cx: *mut JSContext, obj: HandleObject, parent_proto: HandleObject, clasp: *const JSClass, constructor: JSNative, nargs: ::std::os::raw::c_uint, ps: *const JSPropertySpec, fs: *const JSFunctionSpec, static_ps: *const JSPropertySpec, static_fs: *const JSFunctionSpec) -> *mut JSObject); +wrap!(jsapi: pub fn JS_LinkConstructorAndPrototype(cx: *mut JSContext, ctor: HandleObject, proto: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_InstanceOf(cx: *mut JSContext, obj: HandleObject, clasp: *const JSClass, args: *mut CallArgs) -> bool); +wrap!(jsapi: pub fn JS_HasInstance(cx: *mut JSContext, obj: HandleObject, v: Handle, bp: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_GetConstructor(cx: *mut JSContext, proto: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewObjectWithGivenProto(cx: *mut JSContext, clasp: *const JSClass, proto: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_DeepFreezeObject(cx: *mut JSContext, obj: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_FreezeObject(cx: *mut JSContext, obj: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_GetPrototype(cx: *mut JSContext, obj: HandleObject, result: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_GetPrototypeIfOrdinary(cx: *mut JSContext, obj: HandleObject, isOrdinary: *mut bool, result: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_SetPrototype(cx: *mut JSContext, obj: HandleObject, proto: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_IsExtensible(cx: *mut JSContext, obj: HandleObject, extensible: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_PreventExtensions(cx: *mut JSContext, obj: HandleObject, result: *mut ObjectOpResult) -> bool); +wrap!(jsapi: pub fn JS_SetImmutablePrototype(cx: *mut JSContext, obj: HandleObject, succeeded: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_AssignObject(cx: *mut JSContext, target: HandleObject, src: HandleObject) -> bool); +wrap!(jsapi: pub fn JS_SetAllNonReservedSlotsToUndefined(obj: HandleObject)); +wrap!(jsapi: pub fn JS_GetFunctionLength(cx: *mut JSContext, fun: HandleFunction, length: *mut u16) -> bool); wrap!(jsapi: pub fn JS_GetFunctionScript(cx: *mut JSContext, fun: HandleFunction) -> *mut JSScript); wrap!(jsapi: pub fn JS_DecompileScript(cx: *mut JSContext, script: Handle<*mut JSScript>) -> *mut JSString); wrap!(jsapi: pub fn JS_DecompileFunction(cx: *mut JSContext, fun: Handle<*mut JSFunction>) -> *mut JSString); -wrap!(jsapi: pub fn JS_AtomizeAndPinJSString(cx: *mut JSContext, str: HandleString) -> *mut JSString); -wrap!(jsapi: pub fn JS_NewDependentString(cx: *mut JSContext, str: HandleString, start: usize, length: usize) -> *mut JSString); -wrap!(jsapi: pub fn JS_ConcatStrings(cx: *mut JSContext, left: HandleString, right: HandleString) -> *mut JSString); -wrap!(jsapi: pub fn JS_GetPendingException(cx: *mut JSContext, vp: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn JS_SetPendingException(cx: *mut JSContext, v: HandleValue, behavior: ExceptionStackBehavior)); -wrap!(jsapi: pub fn JS_ErrorFromException(cx: *mut JSContext, obj: HandleObject) -> *mut JSErrorReport); wrap!(jsapi: pub fn JS_IndexToId(cx: *mut JSContext, index: u32, arg1: MutableHandleId) -> bool); wrap!(jsapi: pub fn JS_CharsToId(cx: *mut JSContext, chars: TwoByteChars, arg1: MutableHandleId) -> bool); -wrap!(jsapi: pub fn JS_IsIdentifier(cx: *mut JSContext, str: HandleString, isIdentifier: *mut bool) -> bool); +wrap!(jsapi: pub fn JS_IsIdentifier(cx: *mut JSContext, str_: HandleString, isIdentifier: *mut bool) -> bool); wrap!(jsapi: pub fn JS_FindCompilationScope(cx: *mut JSContext, obj: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewObjectWithoutMetadata(cx: *mut JSContext, clasp: *const JSClass, proto: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn JS_NondeterministicGetWeakMapKeys(cx: *mut JSContext, obj: HandleObject, ret: MutableHandleObject) -> bool); @@ -326,37 +320,47 @@ wrap!(jsapi: pub fn JS_ExecuteScript2(cx: *mut JSContext, envChain: HandleObject wrap!(jsapi: pub fn JS_ExecuteScript3(cx: *mut JSContext, envChain: HandleObjectVector, script: Handle<*mut JSScript>) -> bool); wrap!(jsapi: pub fn JS_Stringify(cx: *mut JSContext, value: MutableHandle, replacer: HandleObject, space: Handle, callback: JSONWriteCallback, data: *mut ::std::os::raw::c_void) -> bool); wrap!(jsapi: pub fn JS_ParseJSON(cx: *mut JSContext, chars: *const u16, len: u32, vp: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_ParseJSON1(cx: *mut JSContext, str: Handle<*mut JSString>, vp: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_ParseJSON1(cx: *mut JSContext, str_: Handle<*mut JSString>, vp: MutableHandle) -> bool); wrap!(jsapi: pub fn JS_ParseJSONWithReviver(cx: *mut JSContext, chars: *const u16, len: u32, reviver: Handle, vp: MutableHandle) -> bool); -wrap!(jsapi: pub fn JS_ParseJSONWithReviver1(cx: *mut JSContext, str: Handle<*mut JSString>, reviver: Handle, vp: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_ParseJSONWithReviver1(cx: *mut JSContext, str_: Handle<*mut JSString>, reviver: Handle, vp: MutableHandle) -> bool); wrap!(jsapi: pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *const JSStructuredCloneData, version: u32, scope: StructuredCloneScope, vp: MutableHandleValue, cloneDataPolicy: *const CloneDataPolicy, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void) -> bool); wrap!(jsapi: pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, data: *mut JSStructuredCloneData, scope: StructuredCloneScope, cloneDataPolicy: *const CloneDataPolicy, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, transferable: HandleValue) -> bool); wrap!(jsapi: pub fn JS_StructuredClone(cx: *mut JSContext, v: HandleValue, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void) -> bool); wrap!(jsapi: pub fn JS_ReadTypedArray(r: *mut JSStructuredCloneReader, vp: MutableHandleValue) -> bool); -wrap!(jsapi: pub fn JS_WriteString(w: *mut JSStructuredCloneWriter, str: HandleString) -> bool); +wrap!(jsapi: pub fn JS_WriteString(w: *mut JSStructuredCloneWriter, str_: HandleString) -> bool); wrap!(jsapi: pub fn JS_WriteTypedArray(w: *mut JSStructuredCloneWriter, v: HandleValue) -> bool); wrap!(jsapi: pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool); wrap!(jsapi: pub fn JS_NewInt8ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewInt8ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewUint8ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewUint8ClampedArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewUint8ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewInt16ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewInt16ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewUint16ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewUint16ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewInt32ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewInt32ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewUint32ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewUint32ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewFloat32ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewFloat32ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewFloat64ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewInt8ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewUint8ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewFloat64ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewUint8ClampedArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewUint8ClampedArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewInt16ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewUint16ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewInt32ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewUint32ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewBigInt64ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewBigInt64ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); +wrap!(jsapi: pub fn JS_NewBigUint64ArrayFromArray(cx: *mut JSContext, array: HandleObject) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewBigUint64ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewFloat32ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); -wrap!(jsapi: pub fn JS_NewFloat64ArrayWithBuffer(cx: *mut JSContext, arrayBuffer: HandleObject, byteOffset: usize, length: i64) -> *mut JSObject); wrap!(jsapi: pub fn JS_GetArrayBufferViewBuffer(cx: *mut JSContext, obj: HandleObject, isSharedMemory: *mut bool) -> *mut JSObject); wrap!(jsapi: pub fn JS_NewDataView(cx: *mut JSContext, buffer: HandleObject, byteOffset: usize, byteLength: usize) -> *mut JSObject); wrap!(jsapi: pub fn JS_ForOfIteratorInit(iterator: *mut ForOfIterator, iterable: HandleValue, nonIterableBehavior: ForOfIterator_NonIterableBehavior) -> bool); wrap!(jsapi: pub fn JS_ForOfIteratorNext(iterator: *mut ForOfIterator, val: MutableHandleValue, done: *mut bool) -> bool); +wrap!(jsapi: pub fn FromPropertyDescriptor(cx: *mut JSContext, desc: Handle, vp: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_GetOwnPropertyDescriptorById(cx: *mut JSContext, obj: HandleObject, id: HandleId, desc: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_GetOwnPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, desc: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_GetOwnUCPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, desc: MutableHandle) -> bool); +wrap!(jsapi: pub fn JS_GetPropertyDescriptorById(cx: *mut JSContext, obj: HandleObject, id: HandleId, desc: MutableHandle, holder: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_GetPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const ::std::os::raw::c_char, desc: MutableHandle, holder: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn JS_GetUCPropertyDescriptor(cx: *mut JSContext, obj: HandleObject, name: *const u16, namelen: usize, desc: MutableHandle, holder: MutableHandleObject) -> bool); +wrap!(jsapi: pub fn SetPropertyIgnoringNamedGetter(cx: *mut JSContext, obj: HandleObject, id: HandleId, v: HandleValue, receiver: HandleValue, ownDesc: Handle, result: *mut ObjectOpResult) -> bool); diff --git a/src/jsglue.cpp b/src/jsglue.cpp index f6292bab4..61572d883 100644 --- a/src/jsglue.cpp +++ b/src/jsglue.cpp @@ -396,11 +396,23 @@ class WrapperProxyHandler : public js::Wrapper virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle desc) const override + JS::MutableHandle> desc) const override { - return mTraps.getOwnPropertyDescriptor - ? mTraps.getOwnPropertyDescriptor(cx, proxy, id, desc) - : js::Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc); + if (mTraps.getOwnPropertyDescriptor) + { + JS::Rooted mpd(cx); + if (desc.isSome()) + { + mpd.set(*desc); + } + bool result = mTraps.getOwnPropertyDescriptor(cx, proxy, id, &mpd); + desc.set(mozilla::ToMaybeRef(&mpd)); + return result; + } + else + { + return js::Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc); + } } virtual bool defineProperty(JSContext *cx, @@ -467,9 +479,16 @@ class ForwardingProxyHandler : public js::BaseProxyHandler virtual bool getOwnPropertyDescriptor(JSContext *cx, JS::HandleObject proxy, JS::HandleId id, - JS::MutableHandle desc) const override + JS::MutableHandle> desc) const override { - return mTraps.getOwnPropertyDescriptor(cx, proxy, id, desc); + JS::Rooted mpd(cx); + if (desc.isSome()) + { + mpd.set(*desc); + } + bool result = mTraps.getOwnPropertyDescriptor(cx, proxy, id, &mpd); + desc.set(mozilla::ToMaybeRef(&mpd)); + return result; } virtual bool defineProperty(JSContext *cx, @@ -604,8 +623,14 @@ InvokeGetOwnPropertyDescriptor( JSContext *cx, JS::HandleObject proxy, JS::HandleId id, JS::MutableHandle desc) { - return static_cast(handler)-> - getOwnPropertyDescriptor(cx, proxy, id, desc); + JS::Rooted> mpd(cx); + bool result = static_cast(handler)-> + getOwnPropertyDescriptor(cx, proxy, id, &mpd); + if (mpd.isSome()) + { + desc.set(*mpd); + } + return result; } bool @@ -1062,13 +1087,13 @@ CallUnbarrieredObjectTracer(JSTracer* trc, JSObject** objp, const char* name) void CallObjectRootTracer(JSTracer* trc, JSObject** objp, const char* name) { - JS::UnsafeTraceRoot(trc, objp, name); + JS::TraceRoot(trc, objp, name); } void CallValueRootTracer(JSTracer* trc, JS::Value* valp, const char* name) { - JS::UnsafeTraceRoot(trc, valp, name); + JS::TraceRoot(trc, valp, name); } bool diff --git a/src/lib.rs b/src/lib.rs index c2bb1e7fa..3e10edbcf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,11 +39,11 @@ extern crate num_traits; pub mod jsapi { pub use mozjs_sys::jsapi::glue::*; pub use mozjs_sys::jsapi::js::detail::*; - pub use mozjs_sys::jsapi::js::Scalar::Type; pub use mozjs_sys::jsapi::js::*; pub use mozjs_sys::jsapi::mozilla::MallocSizeOf; pub use mozjs_sys::jsapi::JS::detail::*; pub use mozjs_sys::jsapi::JS::shadow::Object; + pub use mozjs_sys::jsapi::JS::Scalar::Type; pub use mozjs_sys::jsapi::JS::*; pub use mozjs_sys::jsapi::*; } diff --git a/src/rust.rs b/src/rust.rs index 3bdcbb6e1..897050a50 100644 --- a/src/rust.rs +++ b/src/rust.rs @@ -361,7 +361,7 @@ impl Runtime { context.set(js_context); }); - InitSelfHostedCode(js_context); + InitSelfHostedCode(js_context, Default::default(), None); SetWarningReporter(js_context, Some(report_warning)); @@ -1500,12 +1500,12 @@ pub mod wrappers { use jsapi::ForOfIterator_NonIterableBehavior; use jsapi::HandleIdVector; use jsapi::HandleObjectVector; + use jsapi::InstantiateOptions; use jsapi::JSClass; use jsapi::JSErrorReport; use jsapi::JSExnType; use jsapi::JSFunctionSpec; use jsapi::JSFunctionSpecWithHelp; - use jsapi::JSJitInfo; use jsapi::JSONWriteCallback; use jsapi::JSPrincipals; use jsapi::JSPropertySpec; @@ -1530,8 +1530,6 @@ pub mod wrappers { use jsapi::Symbol; use jsapi::SymbolCode; use jsapi::TranscodeBuffer; - use jsapi::TranscodeRange; - use jsapi::TranscodeResult; use jsapi::TwoByteChars; use jsapi::UniqueChars; use jsapi::Value; @@ -1645,12 +1643,12 @@ pub mod jsapi_wrapped { use jsapi::ForOfIterator_NonIterableBehavior; use jsapi::HandleIdVector; use jsapi::HandleObjectVector; + use jsapi::InstantiateOptions; use jsapi::JSClass; use jsapi::JSErrorReport; use jsapi::JSExnType; use jsapi::JSFunctionSpec; use jsapi::JSFunctionSpecWithHelp; - use jsapi::JSJitInfo; use jsapi::JSONWriteCallback; use jsapi::JSPrincipals; use jsapi::JSPropertySpec; @@ -1675,8 +1673,6 @@ pub mod jsapi_wrapped { use jsapi::Symbol; use jsapi::SymbolCode; use jsapi::TranscodeBuffer; - use jsapi::TranscodeRange; - use jsapi::TranscodeResult; use jsapi::TwoByteChars; use jsapi::UniqueChars; use jsapi::Value; diff --git a/tests/property_descriptor.rs b/tests/property_descriptor.rs index c753402b5..081df6d65 100644 --- a/tests/property_descriptor.rs +++ b/tests/property_descriptor.rs @@ -8,11 +8,15 @@ extern crate mozjs_sys; use std::ptr; -use mozjs::jsapi::{JS_NewGlobalObject, JS_NewPlainObject, FromPropertyDescriptor, JS_DefineProperty, JS_GetPropertyDescriptor}; -use mozjs::jsapi::{JSPROP_ENUMERATE, JSPROP_READONLY, JSPROP_PERMANENT}; +use mozjs::jsapi::{ + FromPropertyDescriptor, JS_DefineProperty, JS_GetPropertyDescriptor, JS_NewGlobalObject, + JS_NewPlainObject, +}; use mozjs::jsapi::{JSAutoRealm, OnNewGlobalHookOption, PropertyDescriptor}; +use mozjs::jsapi::{JSPROP_ENUMERATE, JSPROP_PERMANENT, JSPROP_READONLY}; use mozjs::jsval::{Int32Value, NullValue}; -use mozjs::rust::{JSEngine, Runtime, RealmOptions, SIMPLE_GLOBAL_CLASS}; +use mozjs::rust::{JSEngine, RealmOptions, Runtime, SIMPLE_GLOBAL_CLASS}; +use mozjs_sys::jsapi::JSObject; use mozjs_sys::jsapi::JS_GetProperty; #[test] @@ -37,26 +41,64 @@ fn property_descriptor() { rooted!(in(context) let property = Int32Value(32)); let attrs = (JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY) as u32; - assert!(JS_DefineProperty(context, object.handle().into(), b"property\0" as *const u8 as *const libc::c_char, property.handle().into(), attrs)); + assert!(JS_DefineProperty( + context, + object.handle().into(), + b"property\0" as *const u8 as *const libc::c_char, + property.handle().into(), + attrs + )); rooted!(in(context) let mut descriptor: PropertyDescriptor); + rooted!(in(context) let mut obj: *mut JSObject); - assert!(JS_GetPropertyDescriptor(context, object.handle().into(), b"property\0" as *const u8 as *const libc::c_char, descriptor.handle_mut().into())); - assert_eq!(descriptor.get().attrs, attrs); - assert_eq!(descriptor.get().value.to_int32(), 32); + assert!(JS_GetPropertyDescriptor( + context, + object.handle().into(), + b"property\0" as *const u8 as *const libc::c_char, + descriptor.handle_mut().into(), + obj.handle_mut().into() + )); + assert!(descriptor.get().hasValue_()); + assert!(descriptor.get().enumerable_()); + assert_eq!(descriptor.get().value_.to_int32(), 32); rooted!(in(context) let mut desc = NullValue()); - assert!(FromPropertyDescriptor(context, descriptor.handle().into(), desc.handle_mut().into())); + assert!(FromPropertyDescriptor( + context, + descriptor.handle().into(), + desc.handle_mut().into() + )); rooted!(in(context) let desc_object = desc.to_object()); rooted!(in(context) let mut rval = NullValue()); - assert!(JS_GetProperty(context, desc_object.handle().into(), b"value\0" as *const u8 as *const libc::c_char, rval.handle_mut().into())); + assert!(JS_GetProperty( + context, + desc_object.handle().into(), + b"value\0" as *const u8 as *const libc::c_char, + rval.handle_mut().into() + )); assert_eq!(rval.get().to_int32(), 32); - assert!(JS_GetProperty(context, desc_object.handle().into(), b"configurable\0" as *const u8 as *const libc::c_char, rval.handle_mut().into())); + assert!(JS_GetProperty( + context, + desc_object.handle().into(), + b"configurable\0" as *const u8 as *const libc::c_char, + rval.handle_mut().into() + )); assert!(!rval.get().to_boolean()); - assert!(JS_GetProperty(context, desc_object.handle().into(), b"enumerable\0" as *const u8 as *const libc::c_char, rval.handle_mut().into())); + assert!(JS_GetProperty( + context, + desc_object.handle().into(), + b"enumerable\0" as *const u8 as *const libc::c_char, + rval.handle_mut().into() + )); assert!(rval.get().to_boolean()); - assert!(JS_GetProperty(context, desc_object.handle().into(), b"writable\0" as *const u8 as *const libc::c_char, rval.handle_mut().into())); + assert!(JS_GetProperty( + context, + desc_object.handle().into(), + b"writable\0" as *const u8 as *const libc::c_char, + rval.handle_mut().into() + )); assert!(!rval.get().to_boolean()); } -} \ No newline at end of file +} From 0aabac9c3fe1313a742e32484322217f661f4162 Mon Sep 17 00:00:00 2001 From: cybai Date: Fri, 25 Feb 2022 21:40:17 +0900 Subject: [PATCH 2/2] Add some glue methods back --- src/glue_wrappers.in | 9 +++++++++ src/rust.rs | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/glue_wrappers.in b/src/glue_wrappers.in index 96f3d704d..a1d1c94be 100644 --- a/src/glue_wrappers.in +++ b/src/glue_wrappers.in @@ -1,3 +1,11 @@ +wrap!(glue: pub fn InvokeGetOwnPropertyDescriptor(handler: *const ::libc::c_void, cx: *mut JSContext, proxy: HandleObject, id: HandleId, desc: MutableHandle) -> bool); +wrap!(glue: pub fn InvokeHasOwn(handler: *const ::libc::c_void, cx: *mut JSContext, proxy: HandleObject, id: HandleId, bp: *mut bool) -> bool); +wrap!(glue: pub fn CallJitGetterOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); +wrap!(glue: pub fn CallJitSetterOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); +wrap!(glue: pub fn CallJitMethodOp(info: *const JSJitInfo, cx: *mut JSContext, thisObj: HandleObject, specializedThis: *mut ::libc::c_void, argc: u32, vp: *mut Value) -> bool); +wrap!(glue: pub fn NewProxyObject(aCx: *mut JSContext, aHandler: *const ::libc::c_void, aPriv: HandleValue, proto: *mut JSObject, classp: *const JSClass, aLazyProto: bool) -> *mut JSObject); +wrap!(glue: pub fn WrapperNew(aCx: *mut JSContext, aObj: HandleObject, aHandler: *const ::libc::c_void, aClass: *const JSClass, aSingleton: bool) -> *mut JSObject); +wrap!(glue: pub fn NewWindowProxy(aCx: *mut JSContext, aObj: HandleObject, aHandler: *const ::libc::c_void) -> *mut JSObject); wrap!(glue: pub fn RUST_JSID_IS_INT(id: HandleId) -> bool); wrap!(glue: pub fn RUST_JSID_TO_INT(id: HandleId) -> i32); wrap!(glue: pub fn int_to_jsid(i: i32, id: MutableHandleId)); @@ -5,6 +13,7 @@ wrap!(glue: pub fn RUST_JSID_IS_STRING(id: HandleId) -> bool); wrap!(glue: pub fn RUST_JSID_TO_STRING(id: HandleId) -> *mut JSString); wrap!(glue: pub fn RUST_SYMBOL_TO_JSID(sym: *mut Symbol, id: MutableHandleId)); wrap!(glue: pub fn RUST_JSID_IS_VOID(id: HandleId) -> bool); +wrap!(glue: pub fn RUST_INTERNED_STRING_TO_JSID(cx: *mut JSContext, str: *mut JSString, id: MutableHandleId)); 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)); diff --git a/src/rust.rs b/src/rust.rs index 897050a50..16f658f3c 100644 --- a/src/rust.rs +++ b/src/rust.rs @@ -1506,6 +1506,7 @@ pub mod wrappers { use jsapi::JSExnType; use jsapi::JSFunctionSpec; use jsapi::JSFunctionSpecWithHelp; + use jsapi::JSJitInfo; use jsapi::JSONWriteCallback; use jsapi::JSPrincipals; use jsapi::JSPropertySpec; @@ -1649,6 +1650,7 @@ pub mod jsapi_wrapped { use jsapi::JSExnType; use jsapi::JSFunctionSpec; use jsapi::JSFunctionSpecWithHelp; + use jsapi::JSJitInfo; use jsapi::JSONWriteCallback; use jsapi::JSPrincipals; use jsapi::JSPropertySpec;