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

all: update --napi-modules flag to not have a yes/no #186

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
-->

Load N-API modules (experimental, opt-in by adding this flag).

### `--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 (experimental, opt-in by adding this flag).

.TP
.BR \-\-trace\-warnings
Print stack traces for process warnings (including deprecations).
Expand Down
11 changes: 4 additions & 7 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2470,8 +2470,9 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
snprintf(errmsg,
sizeof(errmsg),
"The module '%s'"
"\nwas compiled against the Node.js API. This feature is "
"\nexperimental and must be enabled on the command-line.",
"\nwas compiled against the ABI-stable Node.js API (N-API)."
"\nThis feature is experimental and must be enabled on the "
"\ncommand-line by adding --napi-modules.",
*filename);
} else {
snprintf(errmsg,
Expand Down Expand Up @@ -3548,7 +3549,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 @@ -3721,10 +3722,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'])