WarnOnImplicitlySetGlobalVar(): warn only on sins inside actual DSL code

(cherry picked from commit b4e3736e31d8bc70ac75ca1522db9c0f28f4fa4d)
This commit is contained in:
Alexander A. Klimov 2019-09-23 15:09:57 +02:00 committed by Michael Friedrich
parent cd71b97249
commit d7d54e53f7

View File

@ -560,7 +560,7 @@ void WarnOnImplicitlySetGlobalVar(const std::unique_ptr<Expression>& setLhs, con
if (var && setLhsParent.IsObject()) {
auto ns (dynamic_pointer_cast<Namespace>(setLhsParent.Get<Object::Ptr>()));
if (ns && ns == ScriptGlobal::GetGlobals()) {
if (ns && ns == ScriptGlobal::GetGlobals() && debug.Path.GetLength()) {
const char *opStr = nullptr;
switch (setOp) {