-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different versions of V8 give different string tags for generator functions: _.isFunction #1498
Comments
I'm using v4.1.0 which has V8 v4.5.103.33 which gives |
That's super odd. |
|
I'm not sure how to get the |
That's a good question, my tests are actually far more complicated and I thought I had made a simple example of the problem, but I can't actually repeat it outside of my code. I'm really not sure how I am obtaining it, and too tired to think just now. Hopefully after some sleep I can take another look at it and figure out what is happening. Otherwise all I can do is push my code and point you at the repo. Quite confused just now. |
On node V8 v4.5.103.33 this is the output of my test, an error was thrown because a function was unexpected.
But on Chromium V8 v4.5.103.34, no error is throw an the output is
Burp And like I said, if I extract the code to make a simple test then all works fine. |
Well, I'm still at a loss as to why this is happening, but I can work around the problem by changing
Though I'm not so happy about this without knowing/understanding the reason behind why this is happening, but I have come to the end of my knowledge and experience and don't know how to investigate it further. If I find a reason for it then I will let you know and if you have any suggestions then I would be glad to hear them. |
I stripped down my project into a pretty bare format, other than the isFunction functions. And when I build and test it.
I have created a repo at https://github.com/Xotic750/faultFunction The content of the file being tested is
And the actual tests, which lodash fails (not suggesting it is lodash's fault).
So there is something repeatable and without all of my code in the way. Build was using |
What version of lodash? |
|
And this errors in Node? |
Yes, v4.1.0 on Fedora 22 which has V8 v4.5.103.33 I haven't run the test in the browser since. |
Can you keep stripping the repro down. Like even remove unneeded tests. |
I'll strip it down even further, to a bare skeleton. |
Hehe, well there is not much reattaining now. 4 file a .gitignore a .npmignore a package.json and the main test file faultFuction.js package.json
faultFunction.js
So, npm install and npm test
|
And finally, remove mocha from the equation
and
and then
Not much left to try, remove --harmony
Voila!! There it is, not that it helps much as I want to use ES6 generators on node, and some older version require --harmony |
Thanks! It's the |
No problem, I just glad to get to the bottom of he issue. I hate being defeated. ;) |
Turns out returning |
Ah right, you live a little, you learn a little. ;) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am getting different results for generator function using
_.isFunction
with different versions of V8.For example
On v4.5.103.33 I get a result of
false
, but on v4.5.103.34 I get a result oftrue
.If I
typeof test
on both versions they returnfunction
, but withObject.prototype.toString.call(test)
I get[object GeneratorFunction]
and[object Function]
respectively. In your source code I see you usetoString
to avoid issues withtypeof
on older browsers, but this now causes problems on newer browsers. I don't know what to suggest, haven't thought about it much yet, but I thougt you should be aware of the issue.The text was updated successfully, but these errors were encountered: