Let's say we have incoming data where we expect List and that is parsed like this:
function transform(data:Test) {
trace(data);
trace(data.l);
trace(data.l.iterator());
for (m in data.l) trace(m);
}
var incoming = haxe.Json.parse('{"l":""}');
transform(incoming);
...
typedef Test = {
var l(default, never):tink.pure.List<String>;
}
Following will output:
src/MainClient.hx:7: { l: '' }src/MainClient.hx:8:src/MainClient.hx:9: { list: [ '' ] }
and then crash:
TypeError: Cannot read property 'length' of undefined at tink_pure_NodeIterator.next
Let's say we have incoming data where we expect List and that is parsed like this:
Following will output:
src/MainClient.hx:7: { l: '' }
src/MainClient.hx:8:
src/MainClient.hx:9: { list: [ '' ] }
and then crash:TypeError: Cannot read property 'length' of undefined at tink_pure_NodeIterator.next