Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The OS::call*() functions #61

Open
IngwiePhoenix opened this issue Oct 8, 2014 · 0 comments
Open

The OS::call*() functions #61

IngwiePhoenix opened this issue Oct 8, 2014 · 0 comments

Comments

@IngwiePhoenix
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant