Skip to content

Conversation

@gabrielschulhof
Copy link
Contributor

Add assertions that conversion and coercion N-APIs return appropriate
error statuses when given NULLs for parameters they expect to not be
NULL.

For napi_get_value_string_* this also checks that it returns
napi_string_expected when passed a napi_value not containing a
string.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Add assertions that conversion and coercion N-APIs return appropriate error statuses when given `NULL`s for parameters they expect to not be `NULL`. For `napi_get_value_string_*` this also checks that it returns `napi_string_expected` when passed a `napi_value` not containing a string.
@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Jun 30, 2020
@gabrielschulhofgabrielschulhof added the node-api Issues and PRs related to the Node-API. label Jun 30, 2020
Copy link
Member

@mhdawsonmhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 7, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

gabrielschulhof pushed a commit that referenced this pull request Jul 8, 2020
Add assertions that conversion and coercion N-APIs return appropriate error statuses when given `NULL`s for parameters they expect to not be `NULL`. For `napi_get_value_string_*` this also checks that it returns `napi_string_expected` when passed a `napi_value` not containing a string. PR-URL: #34142 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@gabrielschulhof
Copy link
ContributorAuthor

Landed in c08920b.

@gabrielschulhofgabrielschulhof deleted the n-api-add-test-conversion-null-checks branch July 8, 2020 17:38
MylesBorins pushed a commit that referenced this pull request Jul 14, 2020
Add assertions that conversion and coercion N-APIs return appropriate error statuses when given `NULL`s for parameters they expect to not be `NULL`. For `napi_get_value_string_*` this also checks that it returns `napi_string_expected` when passed a `napi_value` not containing a string. PR-URL: #34142 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@MylesBorinsMylesBorins mentioned this pull request Jul 14, 2020
MylesBorins pushed a commit that referenced this pull request Jul 16, 2020
Add assertions that conversion and coercion N-APIs return appropriate error statuses when given `NULL`s for parameters they expect to not be `NULL`. For `napi_get_value_string_*` this also checks that it returns `napi_string_expected` when passed a `napi_value` not containing a string. PR-URL: #34142 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Add assertions that conversion and coercion N-APIs return appropriate error statuses when given `NULL`s for parameters they expect to not be `NULL`. For `napi_get_value_string_*` this also checks that it returns `napi_string_expected` when passed a `napi_value` not containing a string. PR-URL: #34142 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Add assertions that conversion and coercion N-APIs return appropriate error statuses when given `NULL`s for parameters they expect to not be `NULL`. For `napi_get_value_string_*` this also checks that it returns `napi_string_expected` when passed a `napi_value` not containing a string. PR-URL: #34142 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
@codebyterecodebytere mentioned this pull request Sep 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.node-apiIssues and PRs related to the Node-API.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@gabrielschulhof@nodejs-github-bot@addaleax@mhdawson