`Database.prototype.aggregate()` cast its arguments without checking
their types, so a missing `options` leaked a raw V8 TypeError and a
non-string `name` was silently coerced. Throw `ERR_INVALID_ARG_TYPE`
like the other sqlite bindings do.
Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/66463
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
The "non-integer callback length" suite in
test-sqlite-options-getter-reentry.js checks that function() and
aggregate() reject a callback whose length property is not an integer.
That is plain argument validation: no property getter runs, and nothing
changes mid-call, so the tests do not belong in a file about option
getters re-entering the database.
Move them into the "input validation" suites that already cover the
other argument type checks for each method. Drop "a normal function
length is still accepted", which duplicates "uses function.length when
false" in test-sqlite-custom-functions.js.
The two tests that put the getter on length itself stay where they are,
since closing the database from that getter is what they exercise.
Refs: https://github.com/nodejs/node/pull/65595
Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65769
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>