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.
26 lines
843 B
26 lines
843 B
1 year ago
|
var DESCRIPTORS = require('../internals/descriptors');
|
||
|
var FUNCTION_NAME_EXISTS = require('../internals/function-name').EXISTS;
|
||
|
var uncurryThis = require('../internals/function-uncurry-this');
|
||
|
var defineProperty = require('../internals/object-define-property').f;
|
||
|
|
||
|
var FunctionPrototype = Function.prototype;
|
||
|
var functionToString = uncurryThis(FunctionPrototype.toString);
|
||
|
var nameRE = /^\s*function ([^ (]*)/;
|
||
|
var regExpExec = uncurryThis(nameRE.exec);
|
||
|
var NAME = 'name';
|
||
|
|
||
|
// Function instances `.name` property
|
||
|
// https://tc39.es/ecma262/#sec-function-instances-name
|
||
|
if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
|
||
|
defineProperty(FunctionPrototype, NAME, {
|
||
|
configurable: true,
|
||
|
get: function () {
|
||
|
try {
|
||
|
return regExpExec(nameRE, functionToString(this))[1];
|
||
|
} catch (error) {
|
||
|
return '';
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
}
|