internal
| 344 | |
| 345 | // internal |
| 346 | asCScriptFunction::asCScriptFunction(asCScriptEngine *engine, asCModule *mod, asEFuncType _funcType) |
| 347 | { |
| 348 | funcType = _funcType; |
| 349 | if( funcType == asFUNC_DELEGATE ) |
| 350 | { |
| 351 | // Delegates behave like object instances, rather than script code |
| 352 | externalRefCount.set(1); |
| 353 | internalRefCount.set(0); |
| 354 | } |
| 355 | else |
| 356 | { |
| 357 | internalRefCount.set(1); |
| 358 | externalRefCount.set(0); |
| 359 | } |
| 360 | |
| 361 | this->engine = engine; |
| 362 | this->scriptData = 0; |
| 363 | module = mod; |
| 364 | objectType = 0; |
| 365 | name = ""; |
| 366 | sysFuncIntf = 0; |
| 367 | signatureId = 0; |
| 368 | dontCleanUpOnException = false; |
| 369 | vfTableIdx = -1; |
| 370 | gcFlag = false; |
| 371 | id = 0; |
| 372 | accessMask = 0xFFFFFFFF; |
| 373 | nameSpace = engine->nameSpaces[0]; |
| 374 | objForDelegate = 0; |
| 375 | funcForDelegate = 0; |
| 376 | listPattern = 0; |
| 377 | funcdefType = 0; |
| 378 | |
| 379 | if( funcType == asFUNC_SCRIPT ) |
| 380 | AllocateScriptFunctionData(); |
| 381 | |
| 382 | // Notify the GC of delegates |
| 383 | if( funcType == asFUNC_DELEGATE ) |
| 384 | engine->gc.AddScriptObjectToGC(this, &engine->functionBehaviours); |
| 385 | } |
| 386 | |
| 387 | void asCScriptFunction::AllocateScriptFunctionData() |
| 388 | { |
nothing calls this directly
no test coverage detected