Node-Red configuration
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.

es.object.proto.js 1.2KB

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. var DESCRIPTORS = require('../internals/descriptors');
  3. var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
  4. var isObject = require('../internals/is-object');
  5. var isPossiblePrototype = require('../internals/is-possible-prototype');
  6. var toObject = require('../internals/to-object');
  7. var requireObjectCoercible = require('../internals/require-object-coercible');
  8. // eslint-disable-next-line es/no-object-getprototypeof -- safe
  9. var getPrototypeOf = Object.getPrototypeOf;
  10. // eslint-disable-next-line es/no-object-setprototypeof -- safe
  11. var setPrototypeOf = Object.setPrototypeOf;
  12. var ObjectPrototype = Object.prototype;
  13. var PROTO = '__proto__';
  14. // `Object.prototype.__proto__` accessor
  15. // https://tc39.es/ecma262/#sec-object.prototype.__proto__
  16. if (DESCRIPTORS && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototype)) try {
  17. defineBuiltInAccessor(ObjectPrototype, PROTO, {
  18. configurable: true,
  19. get: function __proto__() {
  20. return getPrototypeOf(toObject(this));
  21. },
  22. set: function __proto__(proto) {
  23. var O = requireObjectCoercible(this);
  24. if (isPossiblePrototype(proto) && isObject(O)) {
  25. setPrototypeOf(O, proto);
  26. }
  27. }
  28. });
  29. } catch (error) { /* empty */ }