租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
549 B

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