From 75abcea83f4d9b6f1fe7b38c93df246308480889 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Sat, 31 May 2014 12:20:57 -0700 Subject: [PATCH] fix(library/kernel_bindings): Lua API consistency, environment:add method also register declaration in the export table Signed-off-by: Leonardo de Moura --- src/library/kernel_bindings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library/kernel_bindings.cpp b/src/library/kernel_bindings.cpp index d23f5a460..d9b588ffd 100644 --- a/src/library/kernel_bindings.cpp +++ b/src/library/kernel_bindings.cpp @@ -1110,9 +1110,9 @@ static int environment_find(lua_State * L) { return push_optional_declaration(L, static int environment_get(lua_State * L) { return push_declaration(L, to_environment(L, 1).get(to_name_ext(L, 2))); } static int environment_add(lua_State * L) { if (is_declaration(L, 2)) - return push_environment(L, to_environment(L, 1).add(to_declaration(L, 2))); + return push_environment(L, module::add(to_environment(L, 1), to_declaration(L, 2))); else - return push_environment(L, to_environment(L, 1).add(to_certified_declaration(L, 2))); + return push_environment(L, module::add(to_environment(L, 1), to_certified_declaration(L, 2))); } static int environment_replace(lua_State * L) { return push_environment(L, to_environment(L, 1).replace(to_certified_declaration(L, 2))); } static int mk_bare_environment(lua_State * L) {