| 431 | |
| 432 | |
| 433 | void ScriptCallable::pushArgsDynamic(CppiaCtx *ctx, hx::Object *inThis, Array<Dynamic> &inArgs) |
| 434 | { |
| 435 | BCR_VCHECK; |
| 436 | |
| 437 | int inCount = inArgs==null() ? 0 : inArgs->length; |
| 438 | |
| 439 | ctx->push( inThis ); |
| 440 | |
| 441 | for(int a=0;a<argCount;a++) |
| 442 | { |
| 443 | CppiaStackVar &var = args[a]; |
| 444 | |
| 445 | if (a<inCount && (inArgs[a].mPtr || !hasDefault[a])) |
| 446 | { |
| 447 | switch(var.argType) |
| 448 | { |
| 449 | case etInt: |
| 450 | ctx->pushInt(inArgs[a]); |
| 451 | break; |
| 452 | case etFloat: |
| 453 | ctx->pushFloat(inArgs[a]); |
| 454 | break; |
| 455 | case etString: |
| 456 | ctx->pushString(inArgs[a]); |
| 457 | break; |
| 458 | default: |
| 459 | ctx->pushObject(inArgs[a].mPtr); |
| 460 | } |
| 461 | BCR_VCHECK; |
| 462 | } |
| 463 | else |
| 464 | { |
| 465 | pushDefault(ctx,a); |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | |
| 471 | // Return the closure |
no test coverage detected