-
Notifications
You must be signed in to change notification settings - Fork 183
QuickJS support for fetch(). #908
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
Conversation
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.
Pull Request Overview
This PR introduces QuickJS support for the fetch() API by adding new helper functions and modules, updating test cases, and modifying build configurations.
- Added a new qjs_array_length helper and a fetch function (ngx_qjs_ext_fetch) in the QuickJS module.
- Removed skip_all conditions from various fetch-related tests to enable them.
- Updated module registration and build files to incorporate the new fetch support.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/qjs.h / src/qjs.c | Added and implemented qjs_array_length for array length retrieval. |
nginx/t/*.t | Removed skip_all conditions and added test cases for fetch methods. |
nginx/ngx_stream_js_module.c | Registered the new fetch module. |
nginx/ngx_js.h / nginx/ngx_js.c | Declared and defined the fetch function and a new string conversion helper. |
nginx/ngx_http_js_module.c | Conditionally registered the fetch module. |
nginx/config | Updated dependency and source lists to include fetch-related files. |
nginx/ngx_js_http.h | Introduced new HTTP helper definitions for JS integration. |
Comments suppressed due to low confidence (2)
nginx/t/js_fetch_objects.t:273
- Consider adding a comment explaining why both error message prefixes ('Cannot assign to read-only p' and 'no setter for property') are checked, to clarify the rationale behind this condition.
if (!e.message.startsWith('Cannot assign to read-only p') {
nginx/ngx_js.c:2288
- [nitpick] The function name 'ngx_js_ngx_string' is somewhat ambiguous; consider renaming it to something like 'ngx_js_to_ngx_string' to clearly indicate that it converts an njs_str_t to an ngx_str_t.
ngx_int_t ngx_js_ngx_string(njs_vm_t *vm, njs_value_t *value, ngx_str_t *str)
e61a198
to
bea18db
Compare
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.
Otherwise looks good.
ce67f5d
to
f6e7a7b
Compare
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.
Looks good.
Thanks Dmitry. |
No description provided.