bind .onerror to context
Merge pull request #56 from jonathanong/bind-onerror

bind .onerror to context