From ab59ed159a87f724c8ae4d2005868337da619662 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Wed, 5 Aug 2020 22:48:01 +0800 Subject: fix case for extending class without name. --- src/MoonP/moon_compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index 1d9161b..271bc06 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp @@ -49,7 +49,7 @@ inline std::string s(std::string_view sv) { } const std::string_view version() { - return "0.4.5"sv; + return "0.4.6"sv; } // name of table stored in lua registry @@ -4117,7 +4117,7 @@ private: if (!className.empty()) { _buf << ","sv << nll(classDecl) << indent(1) << "__name = "sv << className << (extend ? s(","sv) : Empty) << nll(classDecl); } else { - _buf << nll(classDecl); + _buf << (extend ? s(","sv) : Empty) << nll(classDecl); } if (extend) { _buf << indent(1) << "__parent = "sv << parentVar << nll(classDecl); -- cgit v1.2.3-55-g6feb