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 upStack overflow when calling toString on cyclic values #645
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jinjor
Jun 28, 2016
Contributor
I ran into the same problem when I tried Debug.log on a Json.Value object which includes AudioNode.
The infinite loop is occurring at here in Native/Utils.js.
function toString(v)
{
...
if (type === 'object')
{
var output = [];
for (var k in v)
{
output.push(k + ' = ' + toString(v[k])); // this is called many times
}This is caused by circular reference. AudioContext.destination returns AudioDestinationNode and AudioDestinationNode.context returns AudioContext.destination.
|
I ran into the same problem when I tried The infinite loop is occurring at here in Native/Utils.js. function toString(v)
{
...
if (type === 'object')
{
var output = [];
for (var k in v)
{
output.push(k + ' = ' + toString(v[k])); // this is called many times
}This is caused by circular reference. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lukewestby
Aug 12, 2016
Member
@folkertdev could you rename this to something like "Stack overflow when calling toString on cyclic values"?
|
@folkertdev could you rename this to something like "Stack overflow when calling toString on cyclic values"? |
folkertdev
changed the title from
RangeError in toString for Decode.Value objects
to
Stack overflow when calling toString on cyclic values
Aug 13, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Follow along in the #723 meta issue. |
folkertdev commentedJun 12, 2016
Someone ran into this in the elm slack channel.
Trying to print a Json.Decode.Value object that is generated by Html.Events'
onfunction resultsin a RangeError, originating in the addSlashes function (called by toString).
The weird thing is that when a Json.Value value
is generated with decoders in elm, everything works fine. #539 seems to suggest that the problem is with values that are generated by native modules. Here is an example that gives a RangeError on
elm-lang.org/try (in Chrome, v50 on linux mint)