Skip to content

Commit cbad8e0

Browse files
authored
refactor: use Node-API in comments (#194)
1 parent 29a1a4e commit cbad8e0

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

packages/emnapi/include/node/js_native_api_types.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
#ifdef NAPI_EXPERIMENTAL
88
#define NAPI_VERSION NAPI_VERSION_EXPERIMENTAL
99
#else
10-
// The baseline version for N-API.
11-
// The NAPI_VERSION controls which version will be used by default when
12-
// compilling a native addon. If the addon developer specifically wants to use
13-
// functions available in a new version of N-API that is not yet ported in all
14-
// LTS versions, they can set NAPI_VERSION knowing that they have specifically
15-
// depended on that version.
10+
// The baseline version for Node-API.
11+
// NAPI_VERSION controls which version is used by default when compiling
12+
// a native addon. If the addon developer wants to use functions from a
13+
// newer Node-API version not yet available in all LTS versions, they can
14+
// set NAPI_VERSION to explicitly depend on that version.
1615
#define NAPI_VERSION 8
1716
#endif
1817
#endif
@@ -31,7 +30,7 @@
3130

3231
// This file needs to be compatible with C compilers.
3332
// This is a public include file, and these includes have essentially
34-
// became part of it's API.
33+
// become part of its API.
3534
#include <stddef.h> // NOLINT(modernize-deprecated-headers)
3635
#include <stdint.h> // NOLINT(modernize-deprecated-headers)
3736

packages/runtime/src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export class NodeEnv extends Env {
267267
}
268268
}
269269
warn(
270-
'Uncaught N-API callback exception detected, please run node with option --force-node-api-uncaught-exceptions-policy=true to handle those exceptions properly.',
270+
'Uncaught Node-API callback exception detected, please run node with option --force-node-api-uncaught-exceptions-policy=true to handle those exceptions properly.',
271271
'DeprecationWarning',
272272
'DEP0168'
273273
)

packages/test/constructor/constructor-null.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const assert = require('assert')
44
const { load } = require('../util')
55

6-
// Test passing NULL to object-related N-APIs.
6+
// Test passing NULL to object-related Node-APIs.
77
module.exports = load('constructor').then(({ testNull }) => {
88
const expectedResult = {
99
envIsNull: 'Invalid argument',

packages/test/object/object_null.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const assert = require('assert')
55
const { load } = require('../util')
66

77
module.exports = load('object').then(test_object => {
8-
// Test passing NULL to object-related N-APIs.
8+
// Test passing NULL to object-related Node-APIs.
99
const { testNull } = test_object
1010

1111
const expectedForProperty = {

packages/test/trap_in_thread/binding.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static napi_value Abort(napi_env env, napi_callback_info info) {
2525
napi_threadsafe_function ts_fn;
2626
NODE_API_CALL(env, napi_get_cb_info(env, info, &argc, &argv, NULL, NULL));
2727
NODE_API_CALL(env, napi_create_string_utf8(env,
28-
"N-API Thread-safe Function Test", NAPI_AUTO_LENGTH, &async_name));
28+
"Node-API Thread-safe Function Test", NAPI_AUTO_LENGTH, &async_name));
2929
NODE_API_CALL(env, napi_create_threadsafe_function(env,
3030
argv,
3131
NULL,
@@ -49,7 +49,7 @@ static napi_value ReleaseInThread(napi_env env, napi_callback_info info) {
4949
pthread_t uv_threads;
5050
NODE_API_CALL(env, napi_get_cb_info(env, info, &argc, &argv, NULL, NULL));
5151
NODE_API_CALL(env, napi_create_string_utf8(env,
52-
"N-API Thread-safe Function Test", NAPI_AUTO_LENGTH, &async_name));
52+
"Node-API Thread-safe Function Test", NAPI_AUTO_LENGTH, &async_name));
5353
NODE_API_CALL(env, napi_create_threadsafe_function(env,
5454
argv,
5555
NULL,
@@ -74,7 +74,7 @@ static napi_value AbortInThread(napi_env env, napi_callback_info info) {
7474
pthread_t uv_threads;
7575
NODE_API_CALL(env, napi_get_cb_info(env, info, &argc, &argv, NULL, NULL));
7676
NODE_API_CALL(env, napi_create_string_utf8(env,
77-
"N-API Thread-safe Function Test", NAPI_AUTO_LENGTH, &async_name));
77+
"Node-API Thread-safe Function Test", NAPI_AUTO_LENGTH, &async_name));
7878
NODE_API_CALL(env, napi_create_threadsafe_function(env,
7979
argv,
8080
NULL,

packages/test/tsfn/binding.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// on a threading library for a new project it bears remembering that in the
33
// future libuv may introduce API changes which may render it non-ABI-stable,
44
// which, in turn, may affect the ABI stability of the project despite its use
5-
// of N-API.
5+
// of Node-API.
66
#ifdef __EMSCRIPTEN__
77
#include <emscripten.h>
88
#endif
@@ -233,8 +233,11 @@ static napi_value StartThreadInternal(napi_env env,
233233

234234
NODE_API_ASSERT(env, (ts_fn == NULL), "Existing thread-safe function");
235235
napi_value async_name;
236-
NODE_API_CALL(env, napi_create_string_utf8(env,
237-
"N-API Thread-safe Function Test", NAPI_AUTO_LENGTH, &async_name));
236+
NODE_API_CALL(env,
237+
napi_create_string_utf8(env,
238+
"Node-API Thread-safe Function Test",
239+
NAPI_AUTO_LENGTH,
240+
&async_name));
238241
NODE_API_CALL(env,
239242
napi_get_value_uint32(env, argv[3], &ts_info.max_queue_size));
240243
NODE_API_CALL(env, napi_create_threadsafe_function(env,

0 commit comments

Comments
 (0)