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.

16 lines
446 B

4 years ago
  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true);
  4. var $ArrayProto = GetIntrinsic('%Array.prototype%');
  5. module.exports = originalSetProto || (
  6. // eslint-disable-next-line no-proto, no-negated-condition
  7. [].__proto__ !== $ArrayProto
  8. ? null
  9. : function (O, proto) {
  10. O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign
  11. return O;
  12. }
  13. );