Last active
August 29, 2015 13:56
-
-
Save bajtos/8868797 to your computer and use it in GitHub Desktop.
JavaScript function displayName
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = function() { | |
throw new Error('oops'); | |
}; | |
f.displayName = 'myfunc'; | |
f(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node -v | |
v0.10.24 | |
$ node test.js | |
test.js:2 | |
throw new Error('oops'); | |
^ | |
Error: oops | |
at f (test.js:2:9) | |
at Object.<anonymous> (test.js:7:1) | |
at Module._compile (module.js:456:26) | |
at Object.Module._extensions..js (module.js:474:10) | |
at Module.load (module.js:356:32) | |
at Function.Module._load (module.js:312:12) | |
at Function.Module.runMain (module.js:497:10) | |
at startup (node.js:119:16) | |
at node.js:902:3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output: