sorensen / get-function-name.js

Get the name of a function
MIT License
0 stars 1 forks source link

Rework to return null for no-name, and error on invalid input #1

Open anko opened 9 years ago

anko commented 9 years ago

Passing a non-function into something that gives you the name of a function is clearly a user error and should be treated as such.

Returning null for functions that don't have a name makes more sense than the previous mapping to "anonymous": You can have a function with a name "anonymous", which that could be confused with.

Some other fixes too while I was in there—see commit messages.

Bump to v1?