New InputContext.getText() API returns a Promise. So this line should be changed to
```inputContext.getText().then(function gotText() {```