diff --git a/include/chaiscript/dispatchkit/bootstrap.hpp b/include/chaiscript/dispatchkit/bootstrap.hpp index 579b6ee..dd1f880 100644 --- a/include/chaiscript/dispatchkit/bootstrap.hpp +++ b/include/chaiscript/dispatchkit/bootstrap.hpp @@ -486,10 +486,10 @@ namespace chaiscript m->add(chaiscript::fun(&has_parse_tree), "has_parse_tree"); m->add(chaiscript::fun(&get_parse_tree), "get_parse_tree"); - m->add(chaiscript::user_type("eval_error")); + m->add(chaiscript::user_type(), "eval_error"); m->add(chaiscript::base_class()); - m->add(chaiscript::user_type("arithmetic_error")); + m->add(chaiscript::user_type(), "arithmetic_error"); m->add(chaiscript::base_class()); diff --git a/unittests/divide_by_zero_protection.chai b/unittests/divide_by_zero_protection.chai new file mode 100644 index 0000000..ba40a43 --- /dev/null +++ b/unittests/divide_by_zero_protection.chai @@ -0,0 +1,7 @@ +try { + 3/0 + assert_true(false); // should never get here +} catch (e) { + assert_equal("Arithmetic error: divide by zero", e.what()) +} +