Commit Graph

4 Commits

Author SHA1 Message Date
Ruben Bridgewater
b08a867d60
benchmark,doc,lib: capitalize more comments
PR-URL: https://github.com/nodejs/node/pull/26849
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2019-03-27 17:20:06 +01:00
Daniel Bevenius
b1dce4cfe7 test: fix compiler warning in test_string.c
Currently, the following compiler warnings is generated:

../test_string.c:235:50: warning:
incompatible pointer types passing 'char [1]' to parameter of type
'const char16_t *' (aka 'const unsigned short *')
[-Wincompatible-pointer-types]
NAPI_CALL(env, napi_create_string_utf16(env,
    "", ((size_t)INT_MAX) + 1, &output));
    ^~
../../common.h:50:23: note: expanded from macro 'NAPI_CALL'
  NAPI_CALL_BASE(env, the_call, NULL)
                      ^~~~~~~~
../../common.h:42:10: note: expanded from macro 'NAPI_CALL_BASE'
    if ((the_call) != napi_ok) {                               \
         ^~~~~~~~
/node/src/js_native_api.h:80:66: note:
passing argument to parameter 'str' here const char16_t* str,
                                                         ^
1 warning generated.

This commit adds a cast to silence this warning.

PR-URL: https://github.com/nodejs/node/pull/26539
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-12 06:12:07 +01:00
Anthony Tuininga
914d908359
n-api: improve performance creating strings
Improve performance creating strings using N-API by ensuring that the
strings are not internalized.

Added test cases for latin-1 and utf-16 strings.

PR-URL: https://github.com/nodejs/node/pull/26439
Fixes: https://github.com/nodejs/node/issues/26437
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-03-09 00:21:50 +01:00
Gabriel Schulhof
938e11882b test: partition N-API tests
Partition test/addons-napi into test/js-native-api and test/node-api to
isolate the Node.js-agnostic portion of the N-API tests from the
Node.js-specific portion.

PR-URL: https://github.com/nodejs/node/pull/24557
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-12-04 13:58:17 -08:00