improved filters

--HG--
branch : trunk
diff --git a/jinja2/nodes.py b/jinja2/nodes.py
index 51c3039..c579395 100644
--- a/jinja2/nodes.py
+++ b/jinja2/nodes.py
@@ -419,6 +419,8 @@
         if obj is None:
             obj = self.node.as_const()
         args = [x.as_const() for x in self.args]
+        if getattr(filter, 'environmentfilter', False):
+            args.insert(0, self.environment)
         kwargs = dict(x.as_const() for x in self.kwargs)
         if self.dyn_args is not None:
             try: