function toObject(value) {
    // null or undefined
    if (value == null) {
        throw new TypeError('Cannot convert null or undefined to object');
    }

    return value;
}
Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow
the ES5 abstract operation `ToObject`.

@private
@param {*} value Object to check and return.
@returns {*} The provided object.