Skip to content

The OS::call*() functions #61

@IngwiePhoenix

Description

@IngwiePhoenix

As I haven't seen you in Skype in a while, I have been working on finalizing ObjectScriptValue. It can actually already be used, which is plain awesome. But I am a bit stuck on the function calling - especially, that there are three functions:

void call(int params = 0, int ret_values = 0, OS_ECallType call_type = OS_CALLTYPE_AUTO);   // stack: func, this, params
        void callFT(int params = 0, int ret_values = 0, OS_ECallType call_type = OS_CALLTYPE_AUTO); // stack: func, this, params
        void callTF(int params = 0, int ret_values = 0, OS_ECallType call_type = OS_CALLTYPE_AUTO); // stack: this, func, params

What is the difference? Assuming the following:

os->pushString("foo");
os->pushNumber(20);
os->getGlobal("myFunc"); // or ->pushValueById(functionID)
os->call(2, 1);

What would be the difference in using callFT(...) and callTF(...)?

EDIT:
Just realized, might should have put the stack placement of the function at the top. But I think you get what I am asking for. Besides, I just pushed the latest code to the ObjectScriptValue repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions