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

Method DefineClass

source/script_object.cpp:3116–3134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3114
3115
3116void Object::DefineClass(name_t aName, Object *aClass)
3117{
3118 auto prop = DefineProperty(aName);
3119
3120 ExprTokenType values[] { aClass, aName }, *param[] { values, values + 1 };
3121
3122 auto info = SimpleHeap::Alloc<NestedClassInfo>();
3123 info->class_object = aClass;
3124 info->constructed = false;
3125 aClass->AddRef();
3126
3127 auto get = new BuiltInFunc { _T(""), Class_GetNestedClass, 1, 1, false, info };
3128 prop->MinParams = 0;
3129 prop->MaxParams = 0;
3130 prop->SetGetter(get);
3131
3132 auto call = new BuiltInFunc { _T(""), Class_CallNestedClass, 1, 1, true, info };
3133 prop->SetMethod(call);
3134}
3135
3136
3137BIF_DECL(Class_GetNestedClass)

Callers

nothing calls this directly

Calls 3

SetGetterMethod · 0.80
SetMethodMethod · 0.80
AddRefMethod · 0.45

Tested by

no test coverage detected