Sha256: be9f559b3da19a25dd124d935ffb1c5ca5b9d222910e75ae5c2dbc8edd67aef8
Contents?: true
Size: 751 Bytes
Versions: 62
Compression:
Stored size: 751 Bytes
Contents
/* */ var getDesc = require('./$').getDesc, isObject = require('./$.is-object'), anObject = require('./$.an-object'); var check = function(O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? function(buggy, set) { try { set = require('./$.ctx')(Function.call, getDesc(Object.prototype, '__proto__').set, 2); set({}, []); } catch (e) { buggy = true; } return function setPrototypeOf(O, proto) { check(O, proto); if (buggy) O.__proto__ = proto; else set(O, proto); return O; }; }() : undefined), check: check };
Version data entries
62 entries across 31 versions & 1 rubygems