Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1b32fc3

Browse filesBrowse files
Gabriel Schulhofaddaleax
authored andcommitted
n-api: fix object test
Passing a pointer to a static integer is sufficient for the test. PR-URL: #19039 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
1 parent 08b83ee commit 1b32fc3
Copy full SHA for 1b32fc3

File tree

Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-4
lines changed
Open diff view settings
Collapse file

‎test/addons-napi/test_object/test_object.c‎

Copy file name to clipboardExpand all lines: test/addons-napi/test_object/test_object.c
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <node_api.h>
22
#include "../common.h"
33
#include <string.h>
4-
#include <stdlib.h>
54

65
static int test_value = 3;
76

@@ -199,9 +198,7 @@ napi_value Wrap(napi_env env, napi_callback_info info) {
199198
napi_value arg;
200199
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, &arg, NULL, NULL));
201200

202-
int32_t* data = malloc(sizeof(int32_t));
203-
*data = test_value;
204-
NAPI_CALL(env, napi_wrap(env, arg, data, NULL, NULL, NULL));
201+
NAPI_CALL(env, napi_wrap(env, arg, &test_value, NULL, NULL, NULL));
205202
return NULL;
206203
}
207204

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.