Skip to content

Commit 6606a26

Browse files
danbevBridgeAR
authored andcommitted
n-api: remove unused Test function
Currently when building the following warning is emitted: ../test_symbol.c:4:19: warning: unused function 'Test' [-Wunused-function] static napi_value Test(napi_env env, napi_callback_info info) { ^ 1 warning generated. This commit removes this unused function. PR-URL: nodejs#20320 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 03e25b6 commit 6606a26

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

test/addons-napi/test_symbol/test_symbol.c

-25
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
#include <node_api.h>
22
#include "../common.h"
33

4-
static napi_value Test(napi_env env, napi_callback_info info) {
5-
size_t argc = 1;
6-
napi_value args[1];
7-
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, args, NULL, NULL));
8-
9-
NAPI_ASSERT(env, argc >= 1, "Wrong number of arguments");
10-
11-
napi_valuetype valuetype;
12-
NAPI_CALL(env, napi_typeof(env, args[0], &valuetype));
13-
14-
NAPI_ASSERT(env, valuetype == napi_symbol,
15-
"Wrong type of arguments. Expects a symbol.");
16-
17-
char buffer[128];
18-
size_t buffer_size = 128;
19-
20-
NAPI_CALL(env, napi_get_value_string_utf8(
21-
env, args[0], buffer, buffer_size, NULL));
22-
23-
napi_value output;
24-
NAPI_CALL(env, napi_create_string_utf8(env, buffer, buffer_size, &output));
25-
26-
return output;
27-
}
28-
294
static napi_value New(napi_env env, napi_callback_info info) {
305
size_t argc = 1;
316
napi_value args[1];

0 commit comments

Comments
 (0)