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

test: pass null params to napi_create_function() #26998

Conversation

octaviansoldea
Copy link

Each one of the following arguments is checked:
napi_env env,
const char* utf8name,
napi_callback cb,
napi_value* result.

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

Each one of the following arguments is checked:
  napi_env env,
  const char* utf8name,
  napi_callback cb,
  napi_value* result.
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Mar 29, 2019
@gabrielschulhof gabrielschulhof added the node-api Issues and PRs related to the Node-API. label Mar 30, 2019
Copy link
Contributor

@gabrielschulhof gabrielschulhof left a comment

Choose a reason for hiding this comment

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

LGTM with a few nits.

&result);

ret[1] = napi_create_function(env,
NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: this and the lines below need a few more spaces of indentation.

static napi_value TestCreateFunctionParameters(napi_env env,
napi_callback_info info) {
napi_status ret[4];
napi_value result, return_value = NULL, prop_value;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: we can forego the initalizer here.

@gabrielschulhof
Copy link
Contributor

1 similar comment
@nodejs-github-bot
Copy link
Collaborator

@BridgeAR
Copy link
Member

BridgeAR commented Apr 9, 2019

@octaviansoldea PTAL

@gabrielschulhof would you also be fine to land this as is without your comments being addressed?

@gabrielschulhof
Copy link
Contributor

@BridgeAR I'm OK with that. I'm surprised the linter hasn't caught any of this.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@gabrielschulhof
Copy link
Contributor

Landed in 06c803d.

gabrielschulhof pushed a commit that referenced this pull request Apr 10, 2019
Each one of the following arguments is checked:
  napi_env env,
  const char* utf8name,
  napi_callback cb,
  napi_value* result.

PR-URL: #26998
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
octaviansoldea pushed a commit to octaviansoldea/node that referenced this pull request Jul 28, 2019
PR-URL: nodejs#26998

This is a refactoring of nodejs#26998
following nodejs#28505.

The functions `add_last_status()` and `add_returned_status()` are now
reused, see also nodejs#28848.

PR-URL: nodejs#26998
PR-URL: nodejs#28505
PR-URL: nodejs#28848
Trott pushed a commit to Trott/io.js that referenced this pull request Aug 1, 2019
This is a refactoring of nodejs#26998
following nodejs#28505.

The functions `add_last_status()` and `add_returned_status()` are now
reused, see also nodejs#28848.

PR-URL: nodejs#28894
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request Aug 2, 2019
This is a refactoring of #26998
following #28505.

The functions `add_last_status()` and `add_returned_status()` are now
reused, see also #28848.

PR-URL: #28894
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants