fei.wang
8 天以前 ae7b22322555448d95fd56f505bafa325c167a26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';
 
var result = require('./')();
 
var test = {
    __proto__: null,
    foo: {}
};
 
/** @type {import('./accessor')} */
module.exports = function hasAccessor() {
    /* eslint no-proto: 0 */
    return result
        && !('toString' in test)
        // eslint-disable-next-line no-extra-parens
        && /** @type {{ __proto__?: typeof Object.prototype }} */ ({}).__proto__ === Object.prototype
        // eslint-disable-next-line no-extra-parens
        && /** @type {ReadonlyArray<never> & { __proto__?: typeof Array.prototype }} */ (
            []).__proto__ === Array.prototype;
};