Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-12-11, Version 23.4.0 (Current), @aduh95 #31

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
882b70c
tools: bump cross-spawn from 7.0.3 to 7.0.5 in /tools/eslint
dependabot[bot] Nov 18, 2024
72eb710
tools: fix riscv64 build failed
luyahan Nov 18, 2024
f9d25ed
doc: add history entry for import assertion removal
aduh95 Nov 18, 2024
83e02dc
build: compile bundled ada conditionally
jirutka Nov 16, 2024
d8eb83c
build: compile bundled simdjson conditionally
jirutka Nov 16, 2024
fffabca
build: compile bundled simdutf conditionally
jirutka Nov 16, 2024
9c61038
deps: update simdutf to 5.6.2
nodejs-github-bot Nov 19, 2024
efb9f05
doc,lib,src,test: unflag sqlite module
cjihrig Nov 19, 2024
8a5d8c7
test_runner: mark context.plan() as stable
cjihrig Nov 19, 2024
8197815
test_runner: mark snapshot testing as stable
cjihrig Nov 19, 2024
219f5f2
doc: include git node release --promote to steps
RafaelGSS Nov 19, 2024
f711a48
doc: fix relative path mention in --allow-fs
RafaelGSS Nov 19, 2024
d093820
tools: lint js in `doc/**/*.md`
LiviaMedeiros Nov 20, 2024
497a9ae
src: fix kill signal on Windows
huseyinacacak-janea Nov 20, 2024
493e16c
test: fix determining lower priority
LiviaMedeiros Nov 20, 2024
5a2a757
doc: add esm examples to node:timers
mfdebian Nov 20, 2024
f48e289
build: fix GN build for sqlite
zcbenz Nov 21, 2024
7768b3d
deps: update simdjson to 3.10.1
nodejs-github-bot Nov 21, 2024
9d07880
doc: remove RedYetiDev from triagers team
Nov 21, 2024
d777d4a
sqlite: add `StatementSync.prototype.iterate` method
tpoisseau Nov 21, 2024
29362ce
test: make x509 crypto tests work with BoringSSL
codebytere Nov 22, 2024
c8bb8a6
doc: fix Node.js 23 column in CHANGELOG.md
richardlau Nov 22, 2024
475141e
tools: add linter for release commit proposals
aduh95 Nov 22, 2024
ccc5a6d
doc: document approach for building wasm in deps
mhdawson Nov 22, 2024
26ec996
build: use variable for crypto dep path
codebytere Nov 23, 2024
4be5047
module: do not warn when require(esm) comes from node_modules
joyeecheung Nov 23, 2024
ff48c29
doc: add esm example for zlib
peixotoleonardo Nov 23, 2024
cf3f7ac
deps: update zlib to 1.3.0.1-motley-7e2e4d7
nodejs-github-bot Aug 18, 2024
93d36bf
crypto: allow non-multiple of 8 in SubtleCrypto.deriveBits
panva Oct 6, 2024
1e0decb
doc: doc how to add message for promotion
mhdawson Nov 13, 2024
2023b09
build: add create release proposal action
RafaelGSS Nov 23, 2024
98f8f4a
doc: order `node:crypto` APIs alphabetically
badkeyy Nov 23, 2024
a4f57f0
assert: add partialDeepStrictEqual
puskin94 Nov 23, 2024
c157e02
test: convert readdir test to use test runner
tchetwin Nov 23, 2024
288416a
deps: upgrade npm to 10.9.1
npm-cli-bot Nov 24, 2024
f7567d4
test: make HTTP/1.0 connection test more robust
FliegendeWurst Nov 24, 2024
c048865
test_runner: simplify hook running logic
cjihrig Nov 25, 2024
30f26ba
lib: avoid excluding symlinks in recursive fs.readdir with filetypes
juanarbol Nov 25, 2024
95e8c4e
test_runner: refactor build Promise in Suite()
cjihrig Nov 22, 2024
7c3a4d4
test_runner: refactor Promise chain in run()
cjihrig Nov 22, 2024
32b1681
tools: use tokenless Codecov uploads
targos Nov 25, 2024
7705724
doc: add vetted courses to the ambassador benefits
mcollina Nov 25, 2024
a3f7db6
doc: add doc for PerformanceObserver.takeRecords()
skyclouds2001 Nov 25, 2024
5b0ce37
assert: optimize partial comparison of two `Set`s
aduh95 Nov 25, 2024
baed276
doc: deprecate passing invalid types in `fs.existsSync`
Ceres6 Nov 25, 2024
1fb30d6
quic: multiple updates to quic impl
jasnell Nov 23, 2024
d180a8a
deps: update simdutf to 5.6.3
nodejs-github-bot Nov 26, 2024
96e846d
deps: update ngtcp2 to 1.9.0
nodejs-github-bot Nov 26, 2024
f99f95f
deps: update corepack to 0.30.0
nodejs-github-bot Nov 26, 2024
9289374
http2: fix memory leak caused by premature listener removing
ywave620 Nov 26, 2024
ce53f16
build: set node_arch to target_cpu in GN
codebytere Nov 26, 2024
7133c04
build: avoid compiling with VS v17.12
StefanStojanovic Nov 26, 2024
971f5f5
src: safely remove the last line from dotenv
islandryu Nov 26, 2024
54c46b8
tools: add WPT updater for specific subsystems
mertcanaltin Nov 26, 2024
4b3919f
tools: update WPT updater
aduh95 Nov 26, 2024
4cdb032
process: deprecate `features.{ipv6,uv}` and `features.tls_*`
Renegade334 Nov 27, 2024
816d37a
cli: implement --trace-env and --trace-env-[js|native]-stack
joyeecheung Nov 27, 2024
fa2b35d
doc: remove confusing and outdated sentence
lpinca Nov 27, 2024
6be3824
doc: fix deprecation codes
panva Nov 27, 2024
e92d51d
doc: improve GN build documentation a bit
codebytere Nov 27, 2024
96926ce
doc: add history entry for textEncoder.encodeInto()
lpinca Nov 27, 2024
d48348a
doc: move history entry to class description
lpinca Nov 27, 2024
498f44a
doc: add FAQ to releases section
RafaelGSS Nov 27, 2024
2cd939c
tools: filter release keys to reduce interactivity
aduh95 Nov 27, 2024
a1b2660
doc: remove unused import from sample code
blended-bram Nov 27, 2024
a238230
lib: refactor code to improve readability
pmarchini Nov 27, 2024
59e4087
doc: add added tag and fix typo sqlite.md
louwers Nov 27, 2024
99858ce
test,crypto: update WebCryptoAPI WPT
panva Nov 28, 2024
a37e5fe
fs: lazily load ReadFileContext
gurgunday Nov 28, 2024
6194435
test: update WPT for url to 67880a4eb83ca9aa732eec4b35a1971ff5bf37ff
nodejs-github-bot Nov 28, 2024
b778a4f
src: fix check fd
theanarkh Nov 28, 2024
d09e57b
quic: update more QUIC implementation
jasnell Nov 24, 2024
cc96fce
tools: fix nghttp3 updater script
aduh95 Nov 28, 2024
d6a6c8a
tools: allow dispatch of `tools.yml` from forks
aduh95 Nov 28, 2024
3852b5c
deps: update zlib to 1.3.0.1-motley-82a5fec
nodejs-github-bot Nov 29, 2024
98ce465
tools: fix update-undici script
targos Nov 29, 2024
9e4f7aa
sqlite: deps include `sqlite3ext.h`
himself65 Nov 29, 2024
f262207
meta: add releasers as CODEOWNERS to proposal action
RafaelGSS Nov 29, 2024
39c9013
build: remove defaults for create-release-proposal
RafaelGSS Nov 30, 2024
3b4ef93
doc: rename file to advocacy-ambassador-program.md
tniessen Nov 30, 2024
a8809fc
test: move test-worker-arraybuffer-zerofill to parallel
lpinca Dec 1, 2024
4dea44e
src: avoid copy on getV8FastApiCallCount
anonrig Dec 1, 2024
26ab8e9
src: remove dead code in async_wrap
Flarna Dec 1, 2024
7b133d6
dgram: check udp buffer size to avoid fd leak
theanarkh Dec 2, 2024
56c4da2
src: use std::string_view for process emit fns
anonrig Dec 2, 2024
30d6041
net: support blocklist for net.Server
theanarkh Dec 2, 2024
b8ab533
module: remove --experimental-default-type
GeoffreyBooth Dec 2, 2024
52dfe5a
deps: update sqlite to 3.47.1
nodejs-github-bot Dec 3, 2024
d17bde6
2024-12-11, Version 23.4.0 (Current)
aduh95 Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
src: use std::string_view for process emit fns
PR-URL: nodejs#56086
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
anonrig authored and targos committed Dec 3, 2024
commit 56c4da240d97e85b64bb4b5c53c8c032584f1107
20 changes: 11 additions & 9 deletions src/node_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@ void CreateEnvProxyTemplate(IsolateData* isolate_data);
void RawDebug(const v8::FunctionCallbackInfo<v8::Value>& args);

v8::MaybeLocal<v8::Value> ProcessEmit(Environment* env,
const char* event,
std::string_view event,
v8::Local<v8::Value> message);

v8::Maybe<bool> ProcessEmitWarningGeneric(Environment* env,
const char* warning,
const char* type = nullptr,
const char* code = nullptr);
std::string_view warning,
std::string_view type = "",
std::string_view code = "");

template <typename... Args>
inline v8::Maybe<bool> ProcessEmitWarning(Environment* env,
const char* fmt,
Args&&... args);

v8::Maybe<bool> ProcessEmitWarningSync(Environment* env, const char* message);
v8::Maybe<bool> ProcessEmitWarningSync(Environment* env,
std::string_view message);
v8::Maybe<bool> ProcessEmitExperimentalWarning(Environment* env,
const char* warning);
v8::Maybe<bool> ProcessEmitDeprecationWarning(Environment* env,
const char* warning,
const char* deprecation_code);
const std::string& warning);
v8::Maybe<bool> ProcessEmitDeprecationWarning(
Environment* env,
const std::string& warning,
std::string_view deprecation_code);

v8::MaybeLocal<v8::Object> CreateProcessObject(Realm* env);
void PatchProcessObject(const v8::FunctionCallbackInfo<v8::Value>& args);
Expand Down
49 changes: 24 additions & 25 deletions src/node_process_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ using v8::Object;
using v8::String;
using v8::Value;

Maybe<bool> ProcessEmitWarningSync(Environment* env, const char* message) {
Maybe<bool> ProcessEmitWarningSync(Environment* env, std::string_view message) {
Isolate* isolate = env->isolate();
Local<Context> context = env->context();
Local<String> message_string = OneByteString(isolate, message);
Local<String> message_string =
OneByteString(isolate, message.data(), message.size());

Local<Value> argv[] = {message_string};
Local<Function> emit_function = env->process_emit_warning_sync();
Expand All @@ -37,24 +38,27 @@ Maybe<bool> ProcessEmitWarningSync(Environment* env, const char* message) {
}

MaybeLocal<Value> ProcessEmit(Environment* env,
const char* event,
std::string_view event,
Local<Value> message) {
Isolate* isolate = env->isolate();

Local<String> event_string;
if (!String::NewFromOneByte(isolate, reinterpret_cast<const uint8_t*>(event))
.ToLocal(&event_string)) return MaybeLocal<Value>();
Local<Value> event_string;
if (!ToV8Value(env->context(), event).ToLocal(&event_string)) {
return MaybeLocal<Value>();
}

Local<Object> process = env->process_object();
Local<Value> argv[] = {event_string, message};
return MakeCallback(isolate, process, "emit", arraysize(argv), argv, {0, 0});
}

Maybe<bool> ProcessEmitWarningGeneric(Environment* env,
const char* warning,
const char* type,
const char* code) {
if (!env->can_call_into_js()) return Just(false);
std::string_view warning,
std::string_view type,
std::string_view code) {
if (!env->can_call_into_js()) {
return Just(false);
}

HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());
Expand All @@ -73,19 +77,16 @@ Maybe<bool> ProcessEmitWarningGeneric(Environment* env,

// The caller has to be able to handle a failure anyway, so we might as well
// do proper error checking for string creation.
if (!String::NewFromUtf8(env->isolate(), warning).ToLocal(&args[argc++]))
if (!ToV8Value(env->context(), warning).ToLocal(&args[argc++])) {
return Nothing<bool>();
}

if (type != nullptr) {
if (!String::NewFromOneByte(env->isolate(),
reinterpret_cast<const uint8_t*>(type))
.ToLocal(&args[argc++])) {
if (!type.empty()) {
if (!ToV8Value(env->context(), type).ToLocal(&args[argc++])) {
return Nothing<bool>();
}
if (code != nullptr &&
!String::NewFromOneByte(env->isolate(),
reinterpret_cast<const uint8_t*>(code))
.ToLocal(&args[argc++])) {
if (!code.empty() &&
!ToV8Value(env->context(), code).ToLocal(&args[argc++])) {
return Nothing<bool>();
}
}
Expand All @@ -100,13 +101,11 @@ Maybe<bool> ProcessEmitWarningGeneric(Environment* env,
return Just(true);
}


std::set<std::string> experimental_warnings;

Maybe<bool> ProcessEmitExperimentalWarning(Environment* env,
const char* warning) {
if (experimental_warnings.find(warning) != experimental_warnings.end())
return Nothing<bool>();
const std::string& warning) {
if (experimental_warnings.contains(warning)) return Nothing<bool>();

experimental_warnings.insert(warning);
std::string message(warning);
Expand All @@ -115,8 +114,8 @@ Maybe<bool> ProcessEmitExperimentalWarning(Environment* env,
}

Maybe<bool> ProcessEmitDeprecationWarning(Environment* env,
const char* warning,
const char* deprecation_code) {
const std::string& warning,
std::string_view deprecation_code) {
return ProcessEmitWarningGeneric(
env, warning, "DeprecationWarning", deprecation_code);
}
Expand Down