Take inherited contexts into accounts for closure functions.
Merge pull request #36 from bnjbvr/inherited-contexts

Take inherited contexts into accounts for closure functions (bug 1081134)