Merge branch 'method_missing' of https://github.com/arBmind/ChaiScript into method_missing
PR #164 Conflicts: include/chaiscript/dispatchkit/dispatchkit.hpp
This commit is contained in:
commit
dc746ee131
@ -825,7 +825,17 @@ namespace chaiscript
|
|||||||
return bv;
|
return bv;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
return dispatch::dispatch(funs, params, m_conversions);
|
return dispatch::dispatch(funs, params, m_conversions);
|
||||||
|
} catch(chaiscript::exception::dispatch_error&) {
|
||||||
|
auto functions = get_function("method_missing");
|
||||||
|
if (!functions.empty()) {
|
||||||
|
std::vector<Boxed_Value> tmp_params(params);
|
||||||
|
tmp_params.insert(tmp_params.begin() + 1, var(t_name));
|
||||||
|
return dispatch::dispatch(functions, tmp_params, m_conversions);
|
||||||
|
}
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user