-
Notifications
You must be signed in to change notification settings - Fork 385
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
Expected int32 as second argument in Firefox with Array.prototype.map #347
Comments
I have v38.0.1 on my Mac and I don't get this error. Which version of the es6-shim are you using? Also, presumably this isn't happening when the shim is loaded, but when your code runs later - how are you calling |
Note that this error is actually what happens in an unshimmed firefox if you do Are you using |
This fails on `Array#map` with a clearer message in Firefox v38. Relates to #347.
Hmm, I'll look closer at our codebase. I'm unsure why the shim itself is causing this problem. When I remove that section from the shim, our tests all pass in Firefox. That seems like it would imply it being an issue in the shim, right? |
It definitely means it's something in the shim conflicting with something in your codebase. However, you could probably remove the other conflict and fix it too :-) Are you using anything that might override |
I'm still trying to track this down. I changed the map part of the shim to:
as that should give us the information we need about what might be failing. Here is a snippit from my output:
And here is a larger snippit with more examples (not just coming from d3). http://pastebin.com/PnK5xbev Any thoughts? The inputs look reasonable relative to other calls that don't fail. I haven't been able to get to a individual failing test case though. When I run just the tests that fail, they pass. Still digging in. FWIW, this is still Firefox only. |
In your |
I was able to narrow it down further. All my tests pass when I don't call
That looks in line with what you're saying about an object having a length of -1. Also, the RangeError is called in Firefox. |
fwiw, the latest Firefox Nightly made a change to |
I look forward to not needing our hack in front of the polyfill. :) |
@ljharb Do you have a link to the Firefox changes? I'd like to track to see when it makes it into stable. |
https://bugzilla.mozilla.org/show_bug.cgi?id=924058 is the overall ToLength bug, but https://bugzilla.mozilla.org/show_bug.cgi?id=1200108 is specific to "map", and the specific one that fixed this issue. |
Is anyone aware of an existing fork of es6-shim that is modified to not cause these errors in Firefox 42 and prior? Ideally it would be a fork that is to be kept up to date with the latest of es6-shim but with the Firefox fix in place until Firefox 45 is released for those that follow the convention of supporting the latest two versions of browsers. So far for my needs are met by commenting out the if statement around the Array.prototype.map wrapping at https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L1244. But I'd rather not include have to maintain a dependency in my own repo. |
@timglaser this specific error was only occurring with the combination of Karma and Firefox. Is it happening for you in FF 42 by itself? If so, I will absolutely fix it. |
@ljharb it is. I'm getting the "expected Int32 second argument" error in production where karma is not included in any form. I just did a double check to make sure I'm not lying :) I'm getting the error in FF 42, but not in FF43, and not in FF 42 if I apply the change I mentioned above (and so far I'm not finding any negative effects in any of our supported browsers due to the change). |
@timglaser on what OS? I can't reproduce it. Can you make a jsfiddle that repros it? |
@ljharb This is happening on OS X and Windows versions of Firefox 42 and Firefox ESR. I'll see if I can get a jsfiddle together. Not likely today. It could be that something in our package other than karma is interacting in a way that highlights this bug. Thanks for being responsive on this! |
@timglaser Absolutely - I will happily fix anything I can reproduce. The remainder of this issue is because with karma, |
@TheSavior @timglaser can you check this again as of c7ff222? I fixed a number of issues regarding |
I had the same problem on prod with FF v29 - v42. I can confirm that c7ff222 helped. Thanks! |
Awesome! It's released as |
|
Hooray, glad I finally found a solution, and was able to reproduce it without Karma! |
When I'm running my test suite in Firefox, I get this error. I haven't been able to successfully track down where my code is calling map such that this would fail which has been quite frustrating. Have you guys seen this before or know what it might be? This error does not occur on Chrome or Safari.
If I remove the part of the shim for Array.prototype.map by commenting out:
then my test suite runs perfectly in Firefox. Any ideas?
The text was updated successfully, but these errors were encountered: