-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
feat: add napi/argv-complex128
#1445
Closed
PoookieCoder
wants to merge
63
commits into
stdlib-js:develop
from
PoookieCoder:feature/@stdlib/napi/argv-complex128
Closed
feat: add napi/argv-complex128
#1445
PoookieCoder
wants to merge
63
commits into
stdlib-js:develop
from
PoookieCoder:feature/@stdlib/napi/argv-complex128
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
napi/argv-complex128
kgryte
reviewed
Mar 2, 2024
Comment on lines
61
to
67
stdlib_assert_napi_value_is_type( env, value, napi_object, message, err ); | ||
if ( *err != NULL ) { | ||
return napi_ok; | ||
} | ||
STDLIB_ASSERT_NAPI_STATUS_OK_RET_VALUE( env, napi_get_property( env, value, re, &real ), "", napi_ok ) | ||
STDLIB_ASSERT_NAPI_STATUS_OK_RET_VALUE( env, napi_get_property( env, value, im, &imaginary ), "", napi_ok ) | ||
*out = stdlib_complex128( real, imaginary ); |
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.
This can be improved. E.g., see
napi_value stdlib_math_base_napi_zz_z( napi_env env, napi_callback_info info, stdlib_complex128_t (*fcn)( stdlib_complex128_t, stdlib_complex128_t ) ) { |
- You state that the input value must be a Complex128 instance. We should relax that requirement. We should allow any object coming from JS with a real and imaginary component (may be either an "own" or "inherited" property).
- You don't validate that the real and imaginary components are numeric.
- You need to unwrap the real and imaginary components before passing to
stdlib_complex128
. E.g.,status = napi_get_value_double( env, xre, &re0 );
PR-URL: stdlib-js#1443 --------- Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]>
PR-URL: stdlib-js#1446 Closes: stdlib-js#775 --------- Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]>
PR-URL: stdlib-js#1430 Closes: stdlib-js#1332 --------- Signed-off-by: Rejoan Sardar <[email protected]> Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]>
PR-URL: stdlib-js#1442 Closes: stdlib-js#1432 --------- Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]>
PR-URL: stdlib-js#1372 Closes: stdlib-js#1324 Signed-off-by: Utkarsh <[email protected]> Signed-off-by: Philipp Burckhardt <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]> Reviewed-by: Athan Reines <[email protected]>
PR-URL: stdlib-js#1462 Signed-off-by: stdlib-bot <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1461 Signed-off-by: stdlib-bot <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1654 Signed-off-by: stdlib-bot <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1456 Reviewed-by: Athan Reines <[email protected]> Signed-off-by: stdlib-bot <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1457 Closes: stdlib-js#1449 --------- Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]>
PR-URL: stdlib-js#1657 Resolves: stdlib-js#1653 --------- Signed-off-by: Philipp Burckhardt <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1454 Closes: stdlib-js#1453 --------- Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]>
PR-URL: stdlib-js#1667 Closes: stdlib-js#1666 --------- Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]>
…entions Closes: stdlib-js#1434 Ref: stdlib-js#1152 PR-URL: stdlib-js#1455 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Signed-off-by: Snehil Shah <[email protected]> Signed-off-by: Athan Reines <[email protected]>
PR-URL: stdlib-js#1677 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Signed-off-by: stdlib-bot <[email protected]>
PR-URL: stdlib-js#1676 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Signed-off-by: stdlib-bot <[email protected]>
PR-URL: stdlib-js#1348 Closes: stdlib-js#1337 --------- Signed-off-by: Aditya Sapra <[email protected]> Signed-off-by: Philipp Burckhardt <[email protected]> Co-authored-by: Athan Reines <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
…egative test values PR-URL: stdlib-js#1458 Signed-off-by: Snehil Shah <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
Closes: stdlib-js#1668 PR-URL: stdlib-js#1670 Co-authored-by: Athan Reines <[email protected]> Co-authored-by: Pranav Goswami <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Pranav Goswami <[email protected]> Signed-off-by: Pranav Goswami <[email protected]> Signed-off-by: Athan Reines <[email protected]>
PR-URL: stdlib-js#1709 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Signed-off-by: stdlib-bot <[email protected]>
PR-URL: stdlib-js#1685 Closes: stdlib-js#754 --------- Signed-off-by: Lovelin <[email protected]> Reviewed-by: Pranav Goswami <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1447 Closes: stdlib-js#852 --------- Signed-off-by: Anudeep Sanapala <[email protected]> Signed-off-by: Philipp Burckhardt <[email protected]> Co-authored-by: stdlib-bot <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1463 Closes: stdlib-js#1327 --------- Signed-off-by: Athan Reines <[email protected]> Signed-off-by: Aditya Sapra <[email protected]> Signed-off-by: Philipp Burckhardt <[email protected]> Co-authored-by: Athan Reines <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
style: add empty line
PR-URL: stdlib-js#1725 Signed-off-by: stdlib-bot <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1726 Reviewed-by: Athan Reines <[email protected]>
Closes: stdlib-js#1718 PR-URL: stdlib-js#1730 Reviewed-by: Athan Reines <[email protected]>
Closes: stdlib-js#772 PR-URL: stdlib-js#1452 Co-authored-by: Athan Reines <[email protected]> Co-authored-by: Pranav Goswami <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Pranav Goswami <[email protected]> Signed-off-by: GUNJ JOSHI <[email protected]> Signed-off-by: Pranav Goswami <[email protected]>
PR-URL: stdlib-js#1349 Closes: stdlib-js#1321 --------- Signed-off-by: Philipp Burckhardt <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Pranav Goswami <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1728 Closes: stdlib-js#1645 Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1719 Closes: stdlib-js#1714 --------- Signed-off-by: Snehil Shah <[email protected]> Signed-off-by: Pranav <[email protected]> Co-authored-by: Pranav <[email protected]> Reviewed-by: Pranav <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1731 Closes: stdlib-js#1721 --------- Signed-off-by: Snehil Shah <[email protected]> Co-authored-by: Pranavchiku <[email protected]> Reviewed-by: Pranavchiku <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
PR-URL: stdlib-js#1737 Signed-off-by: stdlib-bot <[email protected]> Co-authored-by: Planeshifter <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C
Issue involves or relates to C.
Feature
Issue or pull request for adding a new feature.
Native Addons
Issue involves or relates to Node.js native add-ons.
Needs Changes
Pull request which needs changes before being merged.
Utilities
Issue or pull request concerning general utilities.
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.
Resolves #816 .
Description
This pull request adds C APIs for converting a JavaScript
Complex128
object instance to a native C data typestdlib_complex128_t
.Related Issues
This pull request:
@stdlib/napi/argv-complex128
#816Questions
No.
Other
After the review of this PR, the #817 issue can be resolved easily. I will open a PR for the same.
Checklist
@stdlib-js/reviewers