This happens when an object contains a getter that calls another function, passing the original object as a parameter.
For example, the following code will make TypeWiz throw a RangeError at runtime:
function log(o: { someVal: number }) {
console.log(o);
}
function f(o: { someVal: number }) {
return o.someVal;
}
const obj = {
get someVal() {
// this will cause TypeWiz to enter an endless recursion when it tries to enumerate to object's keys:
log(this);
return 5;
}
};
f(obj);
This happens when an object contains a getter that calls another function, passing the original object as a parameter.
For example, the following code will make TypeWiz throw a
RangeError
at runtime:Found while working on mweststrate/immer#128