| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Replace manual ArrayIsArray checks that throw ERR_INVALID_ARG_TYPE with the shared validateArray helper. The error code, argument name and expected type are unchanged, so the thrown error stays identical. Signed-off-by: greenhead <shren0812@gmail.com>
|
Review requested:
|
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #64959 +/- ##
==========================================
- Coverage 90.30% 90.29% -0.01%
==========================================
Files 760 760
Lines 247154 247140 -14
Branches 46613 46609 -4
==========================================
- Hits 223181 223164 -17
- Misses 15443 15454 +11
+ Partials 8530 8522 -8
... and 29 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Replace manual ArrayIsArray checks that throw ERR_INVALID_ARG_TYPE with the shared validateArray helper. The error code, argument name and expected type are unchanged, so the thrown error stays identical. Signed-off-by: greenhead <shren0812@gmail.com> PR-URL: #64959 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com>
Replace manual ArrayIsArray checks that throw ERR_INVALID_ARG_TYPE with the shared validateArray helper. The error code, argument name and expected type are unchanged, so the thrown error stays identical. Signed-off-by: greenhead <shren0812@gmail.com> PR-URL: #64959 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com>
Three call sites still duplicated the ArrayIsArray check that validateArray already performs. Both files were already importing other validators next to these checks. The error code, argument name and expected type are unchanged, so the thrown error stays identical. The ArrayIsArray primordial is no longer used in histogram.js and is dropped from its destructuring; blocklist.js still uses it elsewhere. The existing tests only asserted the error code, so assertions covering the full error message are added for all three call sites. They pass both before and after this change. Refs: #64959 Assisted-by: claude:fable-5 Signed-off-by: JunHwan Choi <devjunsday@gmail.com> PR-URL: #65344 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
| Back | FazBrowse Home | New Git URL |
Replaces manual ArrayIsArray checks that throw ERR_INVALID_ARG_TYPE with the shared validateArray helper, following #39774.
The thrown error is unchanged in all seven spots: validateArray throws ERR_INVALID_ARG_TYPE(name, 'Array', value) under the same !ArrayIsArray(value) condition, and the default minLength = 0 makes its length check a no-op. Existing tests already pin the message, e.g. test-tls-set-default-ca-certificates-error.js asserts The "certs" argument must be an instance of Array.
In lib/internal/streams/iter/{push,broadcast}.js the checks stay synchronous: writev/writevSync threw before reaching any async path, and validateArray throws synchronously too.