phadej / typify

Runtime type checking for JavaScript
BSD 3-Clause "New" or "Revised" License
76 stars 7 forks source link

Recursive values #7

Open phadej opened 11 years ago

phadej commented 11 years ago

With introduction of recursive types, we can give types to recursive values as well, but they aren't handled well. Snipped below enters forever-loop:

typify.alias("rarray", "array rarray");
var arr = [];
arr[0] = arr;
expect(typ.check("rarray", arr).toBeTruthy();