function isReadOnlyAttr(target, prop) {
    if (!(prop in target)) {
        return false;
    }

    const keys = Object.keys(target);

    // Property shouldn't be enumerable.
    if (~keys.indexOf(prop)) {
        return false;
    }

    // Property shouldn't be writable.
    try {
        target[prop] = NEW_VALUE;
    } catch (e) {
        // An error is expected in 'strict' mode
        // for the major browsers.
    }

    if (target[prop] === NEW_VALUE) {
        return false;
    }

    // Properties' descriptor can be changed.
    try {
        Object.defineProperty(target, prop, {
            value: NEW_VALUE
        });
    } catch (e) {
        // If property is configurable
        // an error shouldn't be thrown.
        return false;
    }

    return target[prop] === NEW_VALUE;
}
Checks whether the specified property is present in provided object
and that it's neither enumerable nor writable.

@param {Object} target
@param {string} prop
@returns {boolean}