2017-08-14 05:01:11 +02:00
|
|
|
var dP = require('./_object-dp').f;
|
|
|
|
var FProto = Function.prototype;
|
|
|
|
var nameRE = /^\s*function ([^ (]*)/;
|
|
|
|
var NAME = 'name';
|
2017-05-27 17:36:13 +02:00
|
|
|
|
2016-10-10 03:43:44 +02:00
|
|
|
// 19.2.4.2 name
|
2017-05-27 17:36:13 +02:00
|
|
|
NAME in FProto || require('./_descriptors') && dP(FProto, NAME, {
|
2016-10-10 03:43:44 +02:00
|
|
|
configurable: true,
|
2017-08-14 05:01:11 +02:00
|
|
|
get: function () {
|
2017-05-27 17:36:13 +02:00
|
|
|
try {
|
2017-08-14 05:01:11 +02:00
|
|
|
return ('' + this).match(nameRE)[1];
|
|
|
|
} catch (e) {
|
2017-05-27 17:36:13 +02:00
|
|
|
return '';
|
|
|
|
}
|
2016-10-10 03:43:44 +02:00
|
|
|
}
|
2017-08-14 05:01:11 +02:00
|
|
|
});
|