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

n-api: simplify bigint-from-word creation #34554

Closed

Conversation

gabrielschulhof
Copy link
Contributor

Macro CHECK_MAYBE_EMPTY_WITH_PREAMBLE() does the work of checking
the TryCatch and returning napi_pending_exception so this change
reuses it for napi_create_bigint_words().

Signed-off-by: Gabriel Schulhof @gabrielschulhof

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

Macro `CHECK_MAYBE_EMPTY_WITH_PREAMBLE()` does the work of checking
the `TryCatch` and returning `napi_pending_exception` so this change
reuses it for `napi_create_bigint_words()`.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
@gabrielschulhof gabrielschulhof requested a review from devsnek July 29, 2020 18:14
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jul 29, 2020
@gabrielschulhof gabrielschulhof added the node-api Issues and PRs related to the Node-API. label Jul 29, 2020
@nodejs-github-bot
Copy link
Collaborator

*result = v8impl::JsValueFromV8LocalValue(b.ToLocalChecked());
return napi_clear_last_error(env);
}
CHECK_MAYBE_EMPTY_WITH_PREAMBLE(env, b, napi_generic_failure);

Choose a reason for hiding this comment

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

No tests - no pull-request

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new test included with this PR tests the correct behaviour of CHECK_MAYBE_EMPTY_WITH_PREAMBLE().

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

gabrielschulhof pushed a commit that referenced this pull request Jul 31, 2020
Macro `CHECK_MAYBE_EMPTY_WITH_PREAMBLE()` does the work of checking
the `TryCatch` and returning `napi_pending_exception` so this change
reuses it for `napi_create_bigint_words()`.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: #34554
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@gabrielschulhof
Copy link
Contributor Author

Landed in 0cc2a54.

codebytere pushed a commit that referenced this pull request Aug 5, 2020
Macro `CHECK_MAYBE_EMPTY_WITH_PREAMBLE()` does the work of checking
the `TryCatch` and returning `napi_pending_exception` so this change
reuses it for `napi_create_bigint_words()`.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: #34554
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@codebytere codebytere mentioned this pull request Aug 10, 2020
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Macro `CHECK_MAYBE_EMPTY_WITH_PREAMBLE()` does the work of checking
the `TryCatch` and returning `napi_pending_exception` so this change
reuses it for `napi_create_bigint_words()`.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: #34554
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Macro `CHECK_MAYBE_EMPTY_WITH_PREAMBLE()` does the work of checking
the `TryCatch` and returning `napi_pending_exception` so this change
reuses it for `napi_create_bigint_words()`.

Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: #34554
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@codebytere codebytere mentioned this pull request Sep 28, 2020
@gabrielschulhof gabrielschulhof deleted the simplify-bigint-words branch January 28, 2021 00:14
@gabrielschulhof gabrielschulhof restored the simplify-bigint-words branch January 28, 2021 05:40
@gabrielschulhof gabrielschulhof deleted the simplify-bigint-words branch February 3, 2021 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. node-api Issues and PRs related to the Node-API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants