Function mozjs::jsapi::JS_DefinePropertyById
source · pub unsafe extern "C" fn JS_DefinePropertyById(
cx: *mut JSContext,
obj: Handle<*mut JSObject>,
id: Handle<PropertyKey>,
desc: Handle<PropertyDescriptor>,
result: *mut ObjectOpResult,
) -> bool
Expand description
Define a property on obj.
This function uses JS::ObjectOpResult to indicate conditions that ES6 specifies as non-error failures. This is inconvenient at best, so use this function only if you are implementing a proxy handler’s defineProperty() method. For all other purposes, use one of the many DefineProperty functions below that throw an exception in all failure cases.
Implements: ES6 [[DefineOwnProperty]] internal method.