internal
| 188 | |
| 189 | // internal |
| 190 | void asCScriptFunction::MakeDelegate(asCScriptFunction *func, void *obj) |
| 191 | { |
| 192 | // Increase the reference of the function and object |
| 193 | func->AddRef(); |
| 194 | funcForDelegate = func; |
| 195 | |
| 196 | func->GetEngine()->AddRefScriptObject(obj, func->GetObjectType()); |
| 197 | objForDelegate = obj; |
| 198 | |
| 199 | // The return type and parameters are copied from the delegated method to this object |
| 200 | // TODO: optimize: Do we really need to copy? Whenever requested the delegate can simply return the delegated methods' info directly |
| 201 | parameterTypes = func->parameterTypes; |
| 202 | returnType = func->returnType; |
| 203 | inOutFlags = func->inOutFlags; |
| 204 | |
| 205 | // The delegate doesn't own the parameters as it will only forward them to the real method |
| 206 | // so the exception handler must not clean up the parameters for the delegate |
| 207 | dontCleanUpOnException = true; |
| 208 | } |
| 209 | |
| 210 | // interface |
| 211 | void *asCScriptFunction::GetAuxiliary() const |
no test coverage detected