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

Implement String.prototype.at #12

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

bnoordhuis
Copy link
Contributor

No description provided.

if (JS_IsException(val))
return val;
p = JS_VALUE_GET_STRING(val);
if (JS_ToInt32Sat(ctx, &idx, argv[0])) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case you're wondering why this works without checking argc > 0: this function is called by js_call_c_function() and that function ensures there are at least cfunc.length slots in the argv array, all set to JS_UNDEFINED.

@bnoordhuis bnoordhuis merged commit 5501834 into quickjs-ng:master Nov 5, 2023
7 checks passed
@bnoordhuis bnoordhuis deleted the string-p-at branch November 5, 2023 10:08
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

Successfully merging this pull request may close these issues.

2 participants