Function js::jsapi::JS_DefinePropertyById [] [src]

pub unsafe extern "C" fn JS_DefinePropertyById(
    cx: *mut JSContext,
    obj: HandleObject,
    id: HandleId,
    desc: Handle<PropertyDescriptor>,
    result: *mut ObjectOpResult
) -> bool

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.