src: do not crash when accessing empty WeakRefs
Making .incRef()
and .decRef()
fail silently leads to better error
messages when trying to access the underlying value (as opposed to
crashing inside these methods).
Refs: https://github.com/nodejs/node/pull/25461#issuecomment-524481482
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines