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 Iterator.prototype.take #676

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Implement Iterator.prototype.take #676

merged 3 commits into from
Nov 12, 2024

Conversation

saghul
Copy link
Contributor

@saghul saghul commented Nov 11, 2024

No description provided.

@saghul saghul requested a review from bnoordhuis November 11, 2024 22:26
@@ -40487,12 +40520,14 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValue this_val,
JSIteratorHelperData *it;
JSValue ret;

*pdone = FALSE;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should fix the unitialized jump valgrind caught: https://github.com/quickjs-ng/quickjs/actions/runs/11786411039/job/32829640312

quickjs.c Outdated
Comment on lines 40403 to 40405
if (limit < 0)
fail:
return JS_ThrowRangeError(ctx, "must be positive");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (limit < 0)
fail:
return JS_ThrowRangeError(ctx, "must be positive");
if (limit < 0) {
fail:
return JS_ThrowRangeError(ctx, "must be positive");
}

(dominant style for this kind of thing)

@saghul saghul merged commit 0362c0a into master Nov 12, 2024
47 checks passed
@saghul saghul deleted the iterator-helpers-take branch November 12, 2024 07:10
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