I just found the problem. When you look at my code above it's not quite clear, but in the calculate function (that is called in the onTextChanging), I use the TextArea's text property as input. Apparently I'm not allowed to do this. Looks like it is not set or something, because if I call calculate(text), then it will work
Don't know if it's a bug, but it's definitely weird.