Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign uptoString() for native objects #539
Comments
folkertdev
referenced this issue
Jun 12, 2016
Closed
Stack overflow when calling toString on cyclic values #645
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Follow along in the #723 meta issue. |
evancz
closed this
Sep 22, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
esad commentedMar 26, 2016
I'm working on an Elm wrapper for PouchDB. In the app that uses the wrapper, the model has the reference to the PouchDB object. Trying to
Debug.logthe model record then results inRangeError: Maximum call stack size exceeded.I guess the db object has a cyclic reference somewhere.
To help with this case, and be able to control string representation of a native (wrapped) objects in general, I propose a convention of having a custom (e.g.
elm_toString) function. TheNative.Utils.toStringimplementation could then check ifelm_toStringis defined on an object and instead of iterating through properties, call this function to get the intended string representation.