From 80201073ca5597e6f8d844f36a5ad24ba52e84ad Mon Sep 17 00:00:00 2001 From: Alessandro Date: Sun, 8 Aug 2010 13:42:36 +0200 Subject: [PATCH] Tests are back too --- asobjects.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/asobjects.h b/asobjects.h index f35c6b279d..2dac6f60e7 100644 --- a/asobjects.h +++ b/asobjects.h @@ -217,14 +217,22 @@ CLASSBUILDABLE(IFunction); { if(!bound) { - //If binding with null we are not a class method - //Generate a copy - IFunction* ret=clone(); + IFunction* ret=NULL; + if(c==NULL) + { + //If binding with null we are generated from newFunction, don't copy + ret=this; + } + else + { + //Generate a copy + ret=clone(); + } ret->bound=true; ret->closure_this=c; if(c) c->incRef(); - //ret->closure_level=level; + ret->closure_level=level; //std::cout << "Binding " << ret << std::endl; return ret; }