nuprl/Stopify

Array.flat and Array.flatMap not handled correctly by @stopify/higher-order-functions

Closed this issue · 2 comments

Neither Array.prototype.flat nor Array.prototype.flatMap are handled correctly by @stopify/higher-order-functions. To be more precise, as far as I can tell, they're not handled at all. If a user calls either function, they are handed back a raw array, not hooked by stopifyArray, which is obviously a Bad Thing, and can lead to confusing error messages in Ocelot. Once an array is touched by either function, it is "infected": you can't really very easily get a "cooked" array back.

This is really a problem with any method in Array.prototype that returns an array which we don't patch (I think the abstraction is essentially destined to leak), but Array.flat and Array.flatMap sting in particular, as they're fairly commonly used.

Thanks for pointing this out. It will be an easy fix. However, it may not be deployed in Ocelot until after the end of semester

Fixed in 0.7.3. Should be in Ocelot soon.