2.1.64 [ECMA-262/6] Section 19.1.2 Properties of the Object Constructor

V0073: Object.setPrototypeOf throws an error immediately if parameter O is not an object

The specification states:

 19.1.2.18 Object.setPrototypeOf ( O, proto )
  
     When the setPrototypeOf function is called with arguments O and proto, the following 
     steps are taken:
  
         1.  Let O be RequireObjectCoercible(O).
         2.  ReturnIfAbrupt(O).
         3.  If Type(proto) is neither Object nor Null, throw a TypeError exception.
         4.  If Type(O) is not Object, return O.
         5.  Let status be O.[[SetPrototypeOf]](proto).
         6.  ReturnIfAbrupt(status).
         7.  If status is false, throw a TypeError exception.
         8.  Return O.

All document modes (All versions)

ToObject(O) is done instead of RequireObjectCoercible(O) in step 1. As a result, Object.setPrototypeOf throws an error immediately if parameter O is not an object.