test: replace assert.throws w/ common.expectsError
Converts RangeError assertions to use common.expectsError and includes an assertion for the error code.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines