also detect functions coming from other JavaScript contexts

Fix #362.

Rationale in “[Differences of JavaScript contexts](https://github.com/rogerwang/node-webkit/wiki/Differences-of-JavaScript-contexts)”.