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

Too many arguments #66

Open
better2being opened this issue Feb 26, 2023 · 3 comments
Open

Too many arguments #66

better2being opened this issue Feb 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@better2being
Copy link

Hi~
There is a error message as "JSError: Error: too many arguments",
and a test case is put the code to styp8/examples/simples.js:
console.log(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
if the number of arguments is more than > 10, it will occurs.
console.log(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
10-arguments is fine.

So the question is why cannot pass more than 10-arguments from JS code to Python function?
Thank you.

@better2being
Copy link
Author

assume that change formal argument message to *message in Line14 styp8/examples/console.py and run it.

@buffer buffer self-assigned this Mar 15, 2023
@buffer buffer changed the title too many arguments Too many arguments Aug 21, 2023
@buffer buffer added the bug Something isn't working label Aug 21, 2023
@buffer
Copy link
Collaborator

buffer commented May 6, 2024

I had finally some time to take a look at this misbehaviour. This is not a bug but just the result of a check which used to be performed by PyV8 (and that STPyV8 inherited). The check lives at

https://github.com/cloudflare/stpyv8/blob/master/src/Wrapper.cpp#L735

The author used to set 10 as maximum number of arguments value. I think this is a safe assumption but please feel free to point out use cases where increasing this value could be beneficial. Thanks!

@better2being
Copy link
Author

Thanks for your reply. I have changed the argument from 10 to 12, and it has also failed.
And many malicious js in EK, they use String.fromCharCode( 31, 32, ... to many int ..., 45, 46) to combine malicious code. So it's important to increase the maximum number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants