Skip to content

Commit

Permalink
solved conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
chuanxshi committed Sep 8, 2013
2 parents 6274302 + 9232447 commit bfc7ad1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions general-patterns/function-declarations.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,22 @@

// named function expression
/* Benefits:
* 1. Get's rid of (anonymous functions) when inspecting and debugging
* 2. Doesn't break IE with the added 'Fn' (function name is not the same as the identifier)
* 1. Provides the debugger with an explicit function name: helps stack inspection.
* 2. Allows recursive functions: getData can call itself.
* Issues:
* 1. Can break IE, coffeescript doesn't do function names:
* https://github.com/jashkenas/coffee-script/issues/366
*/
var getData = function getDataFn () {
var getData = function getData () {
};

// named function expression + 'F'
/* Benefits:
* 1. Get's rid of (anonymous function) in stack traces
* 2. Recurse by calling the name + 'F'
* 3. Doesn't break an IE (well, unless there's a function name collision of the sort described here: https://github.com/jashkenas/coffee-script/issues/366#issuecomment-242134)
*/
var getData = function getDataF () {
};


Expand Down

0 comments on commit bfc7ad1

Please sign in to comment.