JeffreyZhao / wind

Asynchronous flow control in JavaScript, with JavaScript.
http://windjs.org/
1.54k stars 238 forks source link

Update src/jscex-jit.js #47

Closed Licshee closed 12 years ago

Licshee commented 12 years ago

We know that due to a parser bug inside Microsoft JScript engine you get undefined value from running eval("(function () {})"), so we can just use this result value as our input condition.

If the implementation can't even guarantee this buggy behavior, then there left nothing we can assume.

Also, in order to fix this problem, just put "0," before our function expression is enough.

JeffreyZhao commented 12 years ago

Thanks mate. Can you give some more explanation about the benefit of using eval(...) over typeof eval(...) === "function"? I know your code works but I'm not so clear why it's better.

JeffreyZhao commented 12 years ago

The pull request would be closed for no further responding, but still thanks for you contribution. I'll publish some guidelines for developing the project so welcome to the world of Wind.js in the future, my friend. :)