Son CV dans un terminal web en Javascript!
https://terminal-cv.gregandev.fr
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.
28 lines
1.0 KiB
28 lines
1.0 KiB
1 year ago
|
/* eslint-disable no-proto -- safe */
|
||
|
var uncurryThis = require('../internals/function-uncurry-this');
|
||
|
var anObject = require('../internals/an-object');
|
||
|
var aPossiblePrototype = require('../internals/a-possible-prototype');
|
||
|
|
||
|
// `Object.setPrototypeOf` method
|
||
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
||
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
||
|
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
||
|
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
||
|
var CORRECT_SETTER = false;
|
||
|
var test = {};
|
||
|
var setter;
|
||
|
try {
|
||
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
||
|
setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
||
|
setter(test, []);
|
||
|
CORRECT_SETTER = test instanceof Array;
|
||
|
} catch (error) { /* empty */ }
|
||
|
return function setPrototypeOf(O, proto) {
|
||
|
anObject(O);
|
||
|
aPossiblePrototype(proto);
|
||
|
if (CORRECT_SETTER) setter(O, proto);
|
||
|
else O.__proto__ = proto;
|
||
|
return O;
|
||
|
};
|
||
|
}() : undefined);
|