Skip to content
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

Conflicting Array (and other?) module name with compiler JS code #576

Closed
xash opened this issue Apr 6, 2014 · 2 comments
Closed

Conflicting Array (and other?) module name with compiler JS code #576

xash opened this issue Apr 6, 2014 · 2 comments

Comments

@xash
Copy link
Contributor

xash commented Apr 6, 2014

@lambdor found a bug with arrays when using ports: xash/Array#2

The problem is, that the compiler uses instanceof Array to check if an object is an JSArray with ports, but also var Array = Elm.Array.make(_elm); for using the module in the code, so the first one will crash. I don't know if Array is the only problematic module, or if there are more to find. However, there seem to be three solutions:
1.) Rename Array and forbid its and eventually other names for modules.
2.) Change var Module = Elm.Module.make(_elm); to something like _Module.
3.) Export an array identifier function to Utils to use it with _U.isArray(o); and fix eventually other conflicts, when they show up.

@evancz
Copy link
Member

evancz commented Apr 15, 2014

I think 3 can be done right now. Would you mind opening a pull request with that change?

The canonical branch makes it fairly straight forward to do solution 2, so I think that's the way to go longer term.

@evancz
Copy link
Member

evancz commented Apr 15, 2014

As a side note, I moved array to master to try to get 0.12.1 ready before webgl can be merged in.

@evancz evancz closed this as completed in aa91356 Apr 15, 2014
evancz pushed a commit that referenced this issue Apr 15, 2014
Fix #576 for Array when having ports with tuples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants