worker: fix passing multiple SharedArrayBuffers at once
V8 has a handle scope below each GetSharedArrayBufferId()
call,
so using a v8::Local
that outlives that handle scope to store
references to SharedArrayBuffer
s is invalid and may cause accidental
de-duplication of passed SharedArrayBuffer
s.
Use a persistent handle instead to address this issue.
Fixes: https://github.com/nodejs/node/issues/28559
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines