Skip to content

Commit

Permalink
Merge branch 'master' into dev/fix_stdcall_calling_convention_msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki committed Mar 4, 2024
2 parents 2bfc964 + 68c5c6e commit 2eed4e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions Distribution/LuaBridge/LuaBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -9863,9 +9863,6 @@ class Namespace : public detail::Registrar
lua_pushcfunction_x(L, &detail::index_metamethod<false>, "__index");
rawsetfield(L, -2, "__index");

lua_pushcfunction_x(L, &detail::newindex_metamethod<false>, "__newindex");
rawsetfield(L, -2, "__newindex");

lua_newtable(L);
lua_rawsetp(L, -2, detail::getPropgetKey());

Expand Down
4 changes: 2 additions & 2 deletions Source/LuaBridge/detail/Namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -1584,8 +1584,8 @@ class Namespace : public detail::Registrar
rawsetfield(L, -2, "__index"); // Stack: ns

// ns.__newindex = newindex_static_metamethod
lua_pushcfunction_x(L, &detail::newindex_metamethod<false>, "__newindex");
rawsetfield(L, -2, "__newindex"); // Stack: pns, ns
//lua_pushcfunction_x(L, &detail::newindex_metamethod<false>, "__newindex");
//rawsetfield(L, -2, "__newindex"); // Stack: pns, ns

lua_newtable(L); // Stack: ns, mt, propget table (pg)
lua_rawsetp(L, -2, detail::getPropgetKey()); // ns [propgetKey] = pg. Stack: ns
Expand Down
5 changes: 2 additions & 3 deletions Tests/Source/NamespaceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ TEST_F(NamespaceTests, NamespaceFromStack)
{
// Create environment table
lua_newtable(L);

luabridge::getNamespaceFromStack(L)
.addFunction("Function", [](int x) { return x; });

Expand Down Expand Up @@ -415,8 +414,8 @@ TEST_F(NamespaceTests, NamespaceFromStackProperties)
ASSERT_TRUE(result().isNumber());
EXPECT_EQ(0, result<int>());

runLua("tab.value_getSetX = 111");
EXPECT_EQ(111, x);
//runLua("tab.value_getSetX = 111");
//EXPECT_EQ(111, x);
}

TEST_F(NamespaceTests, Properties_ProxyCFunctions)
Expand Down

0 comments on commit 2eed4e6

Please sign in to comment.