| 170 | } |
| 171 | |
| 172 | asCScriptFunction *CreateDelegate(asCScriptFunction *func, void *obj) |
| 173 | { |
| 174 | if( func == 0 || obj == 0 ) |
| 175 | { |
| 176 | // TODO: delegate: Should set script exception |
| 177 | return 0; |
| 178 | } |
| 179 | |
| 180 | // Create an instance of a asCScriptFunction with the type asFUNC_DELEGATE |
| 181 | // The delegate shouldn't have a function id and is not added to the engine->scriptFunctions |
| 182 | asCScriptFunction *delegate = asNEW(asCScriptFunction)(static_cast<asCScriptEngine*>(func->GetEngine()), 0, asFUNC_DELEGATE); |
| 183 | if( delegate ) |
| 184 | delegate->MakeDelegate(func, obj); |
| 185 | |
| 186 | return delegate; |
| 187 | } |
| 188 | |
| 189 | // internal |
| 190 | void asCScriptFunction::MakeDelegate(asCScriptFunction *func, void *obj) |
no test coverage detected