|
hace 1 año | |
---|---|---|
.. | ||
.github | hace 1 año | |
helpers | hace 1 año | |
test | hace 1 año | |
.editorconfig | hace 1 año | |
.eslintignore | hace 1 año | |
.eslintrc | hace 1 año | |
.nycrc | hace 1 año | |
CHANGELOG.md | hace 1 año | |
LICENSE | hace 1 año | |
README.md | hace 1 año | |
auto.js | hace 1 año | |
implementation.js | hace 1 año | |
index.js | hace 1 año | |
package.json | hace 1 año | |
polyfill.js | hace 1 año | |
shim.js | hace 1 año |
An ES2015 spec-compliant Function.prototype.name
shim. Invoke its "shim" method to shim Function.prototype.name if it is unavailable.
Note: Function#name
requires a true ES5 environment - specifically, one with ES5 getters.
This package implements the es-shim API interface. It works in an ES5-supported environment and complies with the spec.
Most common usage:
var functionName = require('function.prototype.name');
var assert = require('assert');
assert.equal(functionName(function foo() {}), 'foo');
functionName.shim();
assert.equal(function foo() {}.name, 'foo');
Simply clone the repo, npm install
, and run npm test