src: set function names in SetFastMethod helpers #67869
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 192 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.315
Real PR Conversation Timeline
1 comments
"Review active on #67869"
general
weight: 0.35
jasnell
SetMethodFromTemplate()only callsfunction->SetName()when itsset_function_nameargument is true.SetMethod()andSetMethodNoSideEffect()passtrue, but the threeSetFastMethod()/SetFastMethodNoSideEffect()overloads that install a function on an object passfalse, so the functions they register have an emptyname. This shows inutil.types: v22 moved its predicates fromSetMethodNoSideEffect()toSetFastMethodNoSideEffect(), and since thenutil.types.isProxy.nameand most of the other C++ predicates are''.This makes
SetMethodFromTemplate()always set the name and drops the parameter. Thanks to konard for the report.Fixes: https://github.com/nodejs/node/issues/67826
The new test checks that every
util.typesfunction is named after its property (exceptisArrayBufferView, which isArrayBuffer.isView). It fails with v25.6.1 and passes with this change. Since other bindings registered through these helpers now get names too, I rantools/test.pyforparallel/test-{util,process,buffer,v8,bootstrap,url,perf,timers,crypto}*locally (545 tests), and they pass, as domake format-cpp, cpplint andtools/checkimports.py. The tests above ran on a build of an earlier main with the equivalent change, becauseSetMethodFromTemplate()was introduced after that (#67496); on current main I checked thatsrc/util.cccompiles.AI disclosure: I used an AI assistant to help write the test and this description. I reproduced the issue, reviewed the change and ran the tests above myself.