While I was working on this, the initial version was something like
```javascript
if ((isObject(val) || isFunction(val)) && isFunction(then = val && val.then)) {
```

It is true that this is closer to the spec, but does so at a small cost of readability. Anyhow, will make the change