diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/core-js/modules/es6.function.name.js | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/core-js/modules/es6.function.name.js')
-rw-r--r-- | node_modules/core-js/modules/es6.function.name.js | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/node_modules/core-js/modules/es6.function.name.js b/node_modules/core-js/modules/es6.function.name.js index f824d86d2..05dd333f8 100644 --- a/node_modules/core-js/modules/es6.function.name.js +++ b/node_modules/core-js/modules/es6.function.name.js @@ -1,25 +1,16 @@ -var dP = require('./_object-dp').f - , createDesc = require('./_property-desc') - , has = require('./_has') - , FProto = Function.prototype - , nameRE = /^\s*function ([^ (]*)/ - , NAME = 'name'; - -var isExtensible = Object.isExtensible || function(){ - return true; -}; +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(){ + get: function () { try { - var that = this - , name = ('' + that).match(nameRE)[1]; - has(that, NAME) || !isExtensible(that) || dP(that, NAME, createDesc(5, name)); - return name; - } catch(e){ + return ('' + this).match(nameRE)[1]; + } catch (e) { return ''; } } -});
\ No newline at end of file +}); |