| 13379 | |
| 13380 | |
| 13381 | ResultType Script::VarUnsetError(Var *var) |
| 13382 | { |
| 13383 | bool isUndeclaredLocal = (var->Scope() & (VAR_LOCAL | VAR_DECLARED)) == VAR_LOCAL; |
| 13384 | TCHAR buf[DIALOG_TITLE_SIZE]; |
| 13385 | if (var->Scope() != 0) // Avoid showing "Specifically: global " for temporary VarRefs of unspecified scope, such as those used by Array::FromEnumerable or the debugger. |
| 13386 | { |
| 13387 | LPCTSTR sameNameAsGlobal = isUndeclaredLocal && FindGlobalVar(var->mName) ? _T(" (same name as a global)") : _T(""); |
| 13388 | sntprintf(buf, _countof(buf), _T("%s %s%s"), Var::DeclarationType(var->Scope()), var->mName, sameNameAsGlobal); |
| 13389 | } |
| 13390 | else *buf = '\0'; |
| 13391 | return RuntimeError(ERR_VAR_UNSET, buf); |
| 13392 | } |
| 13393 | |
| 13394 | |
| 13395 |
no test coverage detected