From 1186926f30213376ff6a04ef36a22627d4b89ec1 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Mon, 30 Jan 2012 08:48:01 -0700 Subject: [PATCH] Fix duplicate object attribute name problem --- include/chaiscript/language/chaiscript_eval.hpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index bd2ee1ae..502b6b13 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -1147,8 +1147,19 @@ namespace chaiscript virtual ~Attr_Decl_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss){ try { - t_ss.add(fun(boost::function(boost::bind(&dispatch::detail::Dynamic_Object_Attribute::func, this->children[0]->text, - this->children[1]->text, _1))), this->children[1]->text); + + t_ss.add(Proxy_Function + (new dispatch::detail::Dynamic_Object_Function( + this->children[0]->text, + fun(boost::function(boost::bind(&dispatch::Dynamic_Object::get_attr, + _1, + this->children[1]->text + ))) + ) + ), this->children[1]->text); + +// t_ss.add(fun(boost::function(boost::bind(&dispatch::detail::Dynamic_Object_Attribute::func, this->children[0]->text, + // this->children[1]->text, _1))), this->children[1]->text); } catch (const exception::reserved_word_error &) {