Skip to main content

set_prototype_of

Function set_prototype_of 

Source
pub fn set_prototype_of(v: &Value, proto: &Value) -> Result<bool, String>
Expand description

[[SetPrototypeOf]].

The trap’s answer is the result (10.5.2): false is a refusal, which Object.setPrototypeOf turns into a TypeError and Reflect.setPrototypeOf reports. A non-extensible target’s prototype cannot be changed, so true is checked against the prototype it really has.