Function js::jsapi::SetPropertyIgnoringNamedGetter [] [src]

pub unsafe extern "C" fn SetPropertyIgnoringNamedGetter(
    cx: *mut JSContext,
    obj: HandleObject,
    id: HandleId,
    v: HandleValue,
    receiver: HandleValue,
    ownDesc: Handle<PropertyDescriptor>,
    result: *mut ObjectOpResult
) -> bool

Helper function for HTMLDocument and HTMLFormElement.

These are the only two interfaces that have [OverrideBuiltins], a named getter, and no named setter. They're implemented as proxies with a custom getOwnPropertyDescriptor() method. Unfortunately, overriding getOwnPropertyDescriptor() automatically affects the behavior of set(), which normally is just common sense but is not desired for these two interfaces.

The fix is for these two interfaces to override set() to ignore the getOwnPropertyDescriptor() override.

SetPropertyIgnoringNamedGetter is exposed to make it easier to override set() in this way. It carries out all the steps of BaseProxyHandler::set() except the initial getOwnPropertyDescriptor() call. The caller must supply that descriptor as the 'ownDesc' parameter.

Implemented in proxy/BaseProxyHandler.cpp.