v8: fix native `serdes` constructors
This removes the indirection added by the class Serializer extends _Serializer {}
by utilising THROW_ERR_CONSTRUCT_CALL_REQUIRED
from node_errors.h
, which is used by MessageChannel
to avoid the same issue.
This also makes it so that a new Serializer()
or new Deserializer(buffer)
call with a poisoned Array.prototype[Symbol.iterator]
works fine.
This also prevents:
Object.getPrototypeOf(require('v8').Serializer)()
from crashing the node process.
Related Issues
Fixes: https://github.com/nodejs/node/issues/13326
Refs: https://github.com/nodejs/node/pull/13541
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines