You have to use `call` to set `this` correctly. For example:
```javascript
var styleArray = feature.getStyleFunction().call(feature, resolution);
```