You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
LinqJS enumerables (arrays wrapped by Enumerable.from()) seem to have problems in evaluation while they are being evaluated in another context. My apologies for the vague title here, but I'm not completely sure what the exact problem is.
Here's some simple Javascript test cases demonstrating odd behavior
For some reason I didn't realize that linq.js was from another existing project. Heh.
I just tested against their 3.0.4-beta6, 3.0.3-b4 (as far as I could tell from their source control) and their 2.2.0.2 release and got no repro. There seems to be an issue with the Saltarelle modifications.
FWIW, you can test this issue by simply including mscorlib.js and this project's linq.js in the page and running the Javascript repro I provided in console.
The variable var enumerator; is defined in a scope such that it's shared by all IEnumerators produced by the Enumerable. I can briefly confirm that moving the variable declaration to the anonymous function being passed into new Enumerable() fixes the issue.
I should be able to come up with tests and a pull request.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
LinqJS enumerables (arrays wrapped by Enumerable.from()) seem to have problems in evaluation while they are being evaluated in another context. My apologies for the vague title here, but I'm not completely sure what the exact problem is.
Here's some simple Javascript test cases demonstrating odd behavior
If we replace all uses of
enm
withEnumerable.from(enm)
the issue persists.If we replace all uses of
enm
withEnumerable.from(arr)
we get the expected behavior without issue.I can provide examples demonstrating how we can end up in scenarios like this from C# code, but in the interest of brevity I'll hold off for now.
The text was updated successfully, but these errors were encountered: