Sha256: eabb953a88f40dd0cb3130a834634ec9c65a595d0ddabab899fe04bfb6632d9c

Contents?: true

Size: 680 Bytes

Versions: 15

Compression:

Stored size: 680 Bytes

Contents

var DESCRIPTORS = require('../internals/descriptors');
var defineProperty = require('../internals/object-define-property').f;

var FunctionPrototype = Function.prototype;
var FunctionPrototypeToString = FunctionPrototype.toString;
var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';

// Function instances `.name` property
// https://tc39.github.io/ecma262/#sec-function-instances-name
if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
  defineProperty(FunctionPrototype, NAME, {
    configurable: true,
    get: function () {
      try {
        return FunctionPrototypeToString.call(this).match(nameRE)[1];
      } catch (error) {
        return '';
      }
    }
  });
}

Version data entries

15 entries across 15 versions & 6 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/core-js/modules/es.function.name.js
disco_app-0.18.0 test/dummy/node_modules/core-js/modules/es.function.name.js
disco_app-0.18.2 test/dummy/node_modules/core-js/modules/es.function.name.js
tang-0.2.1 spec/tang_app/node_modules/core-js/modules/es.function.name.js
tang-0.2.0 spec/tang_app/node_modules/core-js/modules/es.function.name.js
tang-0.1.0 spec/tang_app/node_modules/core-js/modules/es.function.name.js
tang-0.0.9 spec/tang_app/node_modules/core-js/modules/es.function.name.js
enju_library-0.3.8 spec/dummy/node_modules/core-js/modules/es.function.name.js
jester-data-8.0.0 node_modules/core-js/modules/es.function.name.js
ezii-os-5.2.1 node_modules/core-js/modules/es.function.name.js
ezii-os-2.0.1 node_modules/core-js/modules/es.function.name.js
ezii-os-1.1.0 node_modules/core-js/modules/es.function.name.js
ezii-os-1.0.0 node_modules/core-js/modules/es.function.name.js
ezii-os-0.0.0.1.0 node_modules/core-js/modules/es.function.name.js
ezii-os-0.0.0.0.1 node_modules/core-js/modules/es.function.name.js