You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
355 B
JavaScript
17 lines
355 B
JavaScript
6 years ago
|
var dP = require('./_object-dp').f;
|
||
|
var FProto = Function.prototype;
|
||
|
var nameRE = /^\s*function ([^ (]*)/;
|
||
|
var NAME = 'name';
|
||
|
|
||
|
// 19.2.4.2 name
|
||
|
NAME in FProto || require('./_descriptors') && dP(FProto, NAME, {
|
||
|
configurable: true,
|
||
|
get: function () {
|
||
|
try {
|
||
|
return ('' + this).match(nameRE)[1];
|
||
|
} catch (e) {
|
||
|
return '';
|
||
|
}
|
||
|
}
|
||
|
});
|