Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Lists, Maps, and Records to coexist in a Union
Currently, Lists, Maps, and Records cannot coexist in a Union because the $read method for these can throw TypeErrors rather than returning them. The Immutable.js List constructor will throw a TypeError when attempting to initialize a list with a non-array-type object, exiting the Union while loop prematurely (before it tests against the other types). This PR adds a try/catch around the $read and swallows any TypeErrors that come out of it. Other error types are thrown so they can be caught up the call stack.
- Loading branch information