Skip to main content

JS_SetPrototype

Function JS_SetPrototype 

Source
pub unsafe extern "C" fn JS_SetPrototype(
    cx: *mut JSContext,
    obj: Handle<*mut JSObject>,
    proto: Handle<*mut JSObject>,
) -> bool
Expand description

Change the prototype of obj.

Implements: ES6 [[SetPrototypeOf]] internal method.

In cases where ES6 [[SetPrototypeOf]] returns false without an exception, JS_SetPrototype throws a TypeError and returns false.