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

toString() for native objects #539

Closed
esad opened this Issue Mar 26, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@esad

esad commented Mar 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.log the model record then results in

RangeError: 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. The Native.Utils.toString implementation could then check if elm_toString is defined on an object and instead of iterating through properties, call this function to get the intended string representation.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Sep 22, 2016

Member

Follow along in the #723 meta issue.

Member

evancz commented Sep 22, 2016

Follow along in the #723 meta issue.

@evancz evancz closed this Sep 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment