Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
43ab5a8
module: add support for abi stable module API
jasongin Mar 20, 2017
a5d43d1
Fix undefined snprintf use for older compiler
jasongin Mar 22, 2017
87c42e7
all: update --napi-modules flag to not have a yes/no
Mar 22, 2017
876e6c8
doc: mention experimental status of --napi-modules flag
Mar 22, 2017
b129624
src: improve message regarding N-API experimental status
Mar 22, 2017
66944b8
test: convert most addons-napi tests to C
Mar 22, 2017
9e3ab83
Use size_t where appropriate (#181)
jasongin Mar 22, 2017
fb8ced4
Convert all locals and parameter names to snake_case (#193)
boingoing Mar 23, 2017
116bd19
Address some minor PR feedback (#187)
jasongin Mar 23, 2017
1b2f2db
Add tests for type casts and coercions (#194)
jasongin Mar 23, 2017
1427b33
napi: change napi_instanceof() to use Symbol.hasInstance
Mar 22, 2017
6b4ce53
Add some type checking (#195)
jasongin Mar 23, 2017
f21ab80
Updates for review feedback (#199)
jasongin Mar 25, 2017
e1ca374
Address PR feedback (#201)
jasongin Mar 27, 2017
9c0b151
Updates for review feedback (#203)
jasongin Mar 28, 2017
375af79
Refcount for v8impl::Reference should be unsigned (#207)
boingoing Mar 28, 2017
20b6cf2
Check value is external in napi_unwrap (#210)
jasongin Mar 29, 2017
7a339c0
Remove the async API sources (#212)
boingoing Mar 29, 2017
232f004
napi: add napi_env to napi_get_last_error_info() (#211)
Mar 29, 2017
aa22a2a
Add the _array suffix to the TypedArray type enum (#213)
boingoing Mar 30, 2017
0e61d00
Fix jslint issue in addons-napi test
jasongin Mar 30, 2017
c87eade
Remove NAPI_EXTERN from napi_addon_register_func
jasongin Mar 31, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
all: update --napi-modules flag to not have a yes/no
This updates the documentation, the error message upon module load
failure, the command line option parsing of the flag, and the way
the N-API addon tests pass the flag to node.

Re #11975 (comment)
Re #11975 (comment)
Fixes nodejs/abi-stable-node#184
Closes nodejs/abi-stable-node#186
  • Loading branch information
Gabriel Schulhof authored and jasongin committed Mar 23, 2017
commit 87c42e70fcdb4247c79f1a07c6cc335c9ff64287
7 changes: 7 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ added: v6.0.0

Silence all process warnings (including deprecations).

### `--napi-modules`
<!-- YAML
added: v8.0.0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use added: REPLACEME here (although 8.0.0 is a reasonable target, of course)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Resolved by f21ab80

-->

Load N-API modules.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could be a bit more descriptive, how about Load native modules compiled for the ABI-stable Node API?


### `--trace-warnings`
<!-- YAML
added: v6.0.0
Expand Down
4 changes: 4 additions & 0 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ Throw errors for deprecations.
.BR \-\-no\-warnings
Silence all process warnings (including deprecations).

.TP
.BR \-\-napi\-modules
Load N-API modules.

.TP
.BR \-\-trace\-warnings
Print stack traces for process warnings (including deprecations).
Expand Down
9 changes: 3 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,8 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
sizeof(errmsg),
"The module '%s'"
"\nwas compiled against the Node.js API. This feature is "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This error message could be a bit more specific than the Node.js API, I’d say. Also, maybe display the flag name here directly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Resolved by b129624

"\nexperimental and must be enabled on the command-line.",
"\nexperimental and must be enabled on the command-line by "
"\nadding --napi-modules.",
*filename);
} else {
snprintf(errmsg,
Expand Down Expand Up @@ -3547,7 +3548,7 @@ static void PrintHelp() {
" --trace-deprecation show stack traces on deprecations\n"
" --throw-deprecation throw an exception on deprecations\n"
" --no-warnings silence all process warnings\n"
" --napi-modules[=yes|no] load N-API modules (default no)\n"
" --napi-modules load N-API modules\n"
" --trace-warnings show stack traces on process warnings\n"
" --redirect-warnings=path\n"
" write warnings to path instead of\n"
Expand Down Expand Up @@ -3720,10 +3721,6 @@ static void ParseArgs(int* argc,
no_deprecation = true;
} else if (strcmp(arg, "--napi-modules") == 0) {
load_napi_modules = true;
} else if (strcmp(arg, "--napi-modules=yes") == 0) {
load_napi_modules = true;
} else if (strcmp(arg, "--napi-modules=no") == 0) {
load_napi_modules = false;
} else if (strcmp(arg, "--no-warnings") == 0) {
no_process_warnings = true;
} else if (strcmp(arg, "--trace-warnings") == 0) {
Expand Down
2 changes: 1 addition & 1 deletion test/addons-napi/testcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import testpy

def GetConfiguration(context, root):
return testpy.AddonTestConfiguration(context, root, 'addons-napi', ['--napi-modules=yes'])
return testpy.AddonTestConfiguration(context, root, 'addons-napi', ['--napi-modules'])