Dictu
Dictu copied to clipboard
Self referencing datatypes
Self referencing datatypes
Summary
If a datatype is self referencing, that in of itself is not an issue, however, if we attempt to do basic operations with the datatype you'll more than likely be hit with a segfault due to an infinite recursion.
Examples
Resolved
var x = [1];
x.push(x);
print(x); // Segfault
>>> const x = [1, 2];
>>> x.push(x);
>>> x == x; // Segfault
>>> import JSON;
>>> const x = [1, 2];
>>> x.push(x);
>>> JSON.stringify(x); // Segfault
Places tested
- ~~Converting to string~~ Resolved by: https://github.com/dictu-lang/Dictu/pull/549
- Equality
- JSON