MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / CountNestedFuncRefs

Method CountNestedFuncRefs

source/script.cpp:7227–7245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7225
7226
7227void Script::CountNestedFuncRefs(UserFunc &aWithin, LPCTSTR aFuncName)
7228{
7229 for (int i = 0; i < aWithin.mVars.mCount; ++i)
7230 {
7231 Var &nfv = *aWithin.mVars.mItem[i];
7232 if (nfv.Type() == VAR_CONSTANT)
7233 {
7234 ASSERT(nfv.HasObject() && dynamic_cast<UserFunc*>(nfv.Object()));
7235 auto &nf = *(UserFunc *)nfv.Object();
7236 Var *uv = nf.mVars.Find(aFuncName);
7237 if (uv && uv->IsAlias())
7238 {
7239 nf.mUpVarCount++;
7240 if (uv->Scope() & VAR_DOWNVAR)
7241 CountNestedFuncRefs(nf, aFuncName);
7242 }
7243 }
7244 }
7245}
7246
7247
7248

Callers

nothing calls this directly

Calls 5

HasObjectMethod · 0.80
IsAliasMethod · 0.80
TypeMethod · 0.45
ObjectMethod · 0.45
FindMethod · 0.45

Tested by

no test coverage detected