function.prototype.name
An ES2015 spec-compliant `Function.prototype.name` shim
Last updated 6 years ago by ljharb .
MIT · Repository · Bugs · Original npm
$ cnpm install function.prototype.name 
SYNC missed versions from official npm registry.

function.prototype.name Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

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:

Example

var functionName = require('function.prototype.name');
var assert = require('assert');

assert.equal(functionName(function foo() {}), 'foo');

functionName.shim();
assert.equal(function foo() {}.name, 'foo');

Tests

Simply clone the repo, npm install, and run npm test

Current Tags

  • 1.1.5                                ...           latest (4 years ago)

2 Versions

  • 1.1.5                                ...           4 years ago
  • 1.1.2                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org