From 065d0c32f1804614e3cc7a3700856fde7df9ab8c Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Thu, 5 Oct 2006 10:53:32 +0000 Subject: [PATCH] Allow a closure as an event handler. Not part of the build. --- extensions/python/dom/nsdom/context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/python/dom/nsdom/context.py b/extensions/python/dom/nsdom/context.py index b75b2de470d0..975c93d30e49 100644 --- a/extensions/python/dom/nsdom/context.py +++ b/extensions/python/dom/nsdom/context.py @@ -92,7 +92,8 @@ class EventListener: # Although handler is already a function object, we must re-bind to # new globals if self.globals is not None: - f = new.function(self.func.func_code, self.globals, self.func.func_name) + f = new.function(self.func.func_code, self.globals, + self.func.func_name, self.func.func_closure) else: f = self.func # Convert the raw pyxpcom object to a magic _nsdom one, that