[v11.x backport] http: reduce usage of public util by refack · Pull Request #26650 · nodejs/node (original) (raw)

@danbev @BridgeAR

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: nodejs#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

@cjihrig @BridgeAR

These were causing compilation warnings.

PR-URL: nodejs#26590 Reviewed-By: Richard Lau riclau@uk.ibm.com Reviewed-By: Yuta Hiroto hello@hiroppy.me Reviewed-By: Refael Ackermann refack@gmail.com

@BridgeAR

Destroy the Worker class earlier, because we don’t need access to it once the thread has stopped and all resources have been cleaned up.

PR-URL: nodejs#26542 Fixes: nodejs#26535 Reviewed-By: Gireesh Punathil gpunathi@in.ibm.com Reviewed-By: Joyee Cheung joyeec9h3@gmail.com Reviewed-By: Gus Caplan me@gus.host Reviewed-By: James M Snell jasnell@gmail.com Reviewed-By: Colin Ihrig cjihrig@gmail.com

@ZYSzys @BridgeAR

PR-URL: nodejs#26538 Reviewed-By: Michaël Zasso targos@protonmail.com Reviewed-By: Luigi Pinca luigipinca@gmail.com Reviewed-By: Ruben Bridgewater ruben@bridgewater.de Reviewed-By: James M Snell jasnell@gmail.com

@joyeecheung @BridgeAR

PR-URL: nodejs#26547 Refs: nodejs#26546 Reviewed-By: Michaël Zasso targos@protonmail.com Reviewed-By: Ruben Bridgewater ruben@bridgewater.de Reviewed-By: James M Snell jasnell@gmail.com

@mscdex @BridgeAR

PR-URL: nodejs#26319 Fixes: nodejs#26316 Reviewed-By: James M Snell jasnell@gmail.com Reviewed-By: Sam Roberts vieuxtech@gmail.com Reviewed-By: Ben Noordhuis info@bnoordhuis.nl Reviewed-By: Tobias Nießen tniessen@tnie.de Reviewed-By: Ujjwal Sharma usharma1998@gmail.com

@refack @BridgeAR

Fixes a bug I introduced in 9613221

PR-URL: nodejs#26570 Refs: nodejs#25870 Refs: nodejs#26473 Reviewed-By: James M Snell jasnell@gmail.com Reviewed-By: Colin Ihrig cjihrig@gmail.com Reviewed-By: Ruben Bridgewater ruben@bridgewater.de Reviewed-By: Rich Trott rtrott@gmail.com Reviewed-By: Ben Noordhuis info@bnoordhuis.nl

@BridgeAR

The ecosystem broke by making it non-writable, so this is a good intermediate fix.

PR-URL: nodejs#26488 Reviewed-By: Michaël Zasso targos@protonmail.com Reviewed-By: Yuta Hiroto hello@hiroppy.me Reviewed-By: James M Snell jasnell@gmail.com

@ronag @BridgeAR

PR-URL: nodejs#24346 Reviewed-By: Luigi Pinca luigipinca@gmail.com Reviewed-By: Matteo Collina matteo.collina@gmail.com Reviewed-By: Ruben Bridgewater ruben@bridgewater.de Reviewed-By: Colin Ihrig cjihrig@gmail.com

@BridgeAR

If this file is loaded with Node.js build without ssl, it will load 'node-inspect/lib/internal/inspect_client' as well. Due to that two deprecation warnings will be emitted instead of one and the test fails.

It should be safe to just test all other cases and to ignore this specific file.