Fix duplicate object attribute name problem

This commit is contained in:
Jason Turner
2012-01-30 08:48:01 -07:00
parent 70db5d67ff
commit 1186926f30

View File

@@ -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<Boxed_Value (dispatch::Dynamic_Object &)>(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<Boxed_Value (dispatch::Dynamic_Object &)>(boost::bind(&dispatch::Dynamic_Object::get_attr,
_1,
this->children[1]->text
)))
)
), this->children[1]->text);
// t_ss.add(fun(boost::function<Boxed_Value (dispatch::Dynamic_Object &)>(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 &) {