| 789 | } |
| 790 | |
| 791 | void pushArgDynamic(CppiaCtx *ctx, int a, Dynamic inValue) |
| 792 | { |
| 793 | // Developer has used dynamic to call a closure with wrong # parameters |
| 794 | if (a>=function->args.size()) |
| 795 | return; |
| 796 | |
| 797 | if (!inValue.mPtr) |
| 798 | { |
| 799 | function->pushDefault(ctx,a); |
| 800 | return; |
| 801 | } |
| 802 | |
| 803 | switch(function->args[a].argType) |
| 804 | { |
| 805 | case etInt: |
| 806 | ctx->pushInt(inValue->__ToInt()); |
| 807 | return; |
| 808 | case etFloat: |
| 809 | ctx->pushFloat(inValue->__ToDouble()); |
| 810 | break; |
| 811 | case etString: |
| 812 | ctx->pushString(inValue.mPtr ? inValue->toString() : String()); |
| 813 | break; |
| 814 | default: |
| 815 | { |
| 816 | hx::Object *value = inValue.mPtr; |
| 817 | if (value) |
| 818 | { |
| 819 | ArrayType want = function->args[a].type->arrayType; |
| 820 | if (want!=arrNotArray) |
| 821 | value = DynamicToArrayType(value, want); |
| 822 | } |
| 823 | ctx->pushObject(value); |
| 824 | } |
| 825 | } |
| 826 | } |
| 827 | |
| 828 | |
| 829 |
nothing calls this directly
no test coverage detected