From 1f1af19560054b47935151f298ff06ff2cad5ef9 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Sat, 2 Apr 2022 09:50:09 +0800 Subject: try fixing overriding issue mentioned in issue #84. --- src/yuescript/yue_compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/yuescript/yue_compiler.cpp b/src/yuescript/yue_compiler.cpp index 26a8c5a..3720915 100755 --- a/src/yuescript/yue_compiler.cpp +++ b/src/yuescript/yue_compiler.cpp @@ -60,7 +60,7 @@ using namespace parserlib; typedef std::list str_list; -const std::string_view version = "0.10.8"sv; +const std::string_view version = "0.10.9"sv; const std::string_view extension = "yue"sv; class YueCompilerImpl { @@ -5344,7 +5344,7 @@ private: auto mixins = _parser.toString(classDecl->mixes); _buf << "for "sv << mixin << " in *{"sv << mixins << "}\n"sv; _buf << "\tfor "sv << key << ',' << val << " in pairs "sv << mixin << ".__base\n"sv; - _buf << "\t\t"sv << baseVar << '[' << key << "]="sv << val << " if not "sv << key << "\\match\"^__\""sv; + _buf << "\t\t"sv << baseVar << '[' << key << "]="sv << val << " if not "sv << key << "\\match\"^__\" and "sv << baseVar << '[' << key << "] == nil"sv; transformBlock(toAst(clearBuf(), x), temp, ExpUsage::Common); } temp.push_back(indent() + baseVar + ".__index = "s + baseVar + nll(classDecl)); -- cgit v1.2.3-55-g6feb