Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add ReadableStream support to k6 #3696
Add ReadableStream support to k6 #3696
Changes from 7 commits
d7fa621
b5e0124
bed700b
5461ef1
d546366
347a26d
b881b97
b73c40f
3ecab30
7401502
c691261
60e087d
1e06c44
cf4f439
31a2554
08824fa
2a90895
c301edc
386dd73
c028e12
a35dad0
89302f2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had an internal discussion about this some time ago, but I see that you are not using the proposed solution of calling the already made by goja TypeError and RangeError constructors. This seems to require changes to the tests as that breaks
instanceof
in them.a quick check shows that
works.
This isn't really blocking, but not using the goja error might be a problem in the future, so if there is a reason this wasn't done it will be nice to know about it.
on the remaining errors:
AssertionError seems to be used in cases where asserts are checked. Which I would argue isn't really necessary as all the asserts I have seen are in practice tests for if the implementation has internal inconsistencies - so panicking outright on those is likely okay, or just ignoring them. Error is not bad, I just would probably use
GoError
RuntimeError seems to be another error you've made up that seems to be for everything not fitting the rest.
Again nothing bad with it ... but I am not certain you shouldn't just use the
Error
constructor or GoError for this one as well 🤷There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a really good idea! I may give it a try, I fully agree that, despite not blocking (most likely), it will probably make our lives easier in the long term
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been trickier than I initially thought, because sometimes we need to return these errors as Go
error
s, or keep them stored in-memory andreturn
/throw
them later. So, we need to either convert every signature intoany
instead oferror
, which would be messy, or un/wrap these errors, which is... meh, but feasible.That said, I feel like like I'm having low inspiration these days, so if you have any other better approach, suggestions will be more than welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I concur with the points brought up by @joanlopez, refactoring the error mechanism here would be quite herculean. I would also much rather do that as a separate task, and even use this as an opportunity to return more standard/conventional JS errors to the runtime :)
I'll open an issue 👍🏻
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.