jlongster/nunjucks — pull request #37 by devoidfury (2012-12-01 18:29:21+00:00)
Title: Fix - give methods proper scope

This fixes #35 and #36.

Quick rundown --

Scope in javascript is unbound (determined by syntax, not by definition). With the addition of suppressing undefined values, an example `{{ form.as_div() }}` output was affected like so:

(suppress(((form) || {})["as_div"]))()

which was losing the scope as it was not being called on an object. This patch adds a binding mechanism for lookups that calls the methods with the intended scope.