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

Default optional arguments do not work with JSCore and v8 generation #33

Open
ewmailing opened this issue Nov 21, 2013 · 0 comments
Open

Comments

@ewmailing
Copy link

According to the docs, this is supposed to work for both C and C++ in a .i file:
bool Init(int val=10);

The SWIG generation for JSCore and v8 fail to account for omitted arguments in this case, so in Javascript, calling
mymodule.Init();
will fail because it doesn't have exactly 1 argument.

The generated code has this check:
if(argc != 1) SWIG_exception_fail(SWIG_ERROR, "Illegal number of arguments for _wrap_Init.");

It needs to be more flexible to allow the default values to be assigned.

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