You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MessagePort.postMessage with custom iterator as transfer list causes Assertion `(index) < (length())' failed. #49940
changed the title [-]structuredClone with custom iterator as transfer list causes Assertion `(index) < (length())' failed.[/-][+]MessagePort.postMessage with custom iterator as transfer list causes Assertion `(index) < (length())' failed.[/+]on Sep 28, 2023
Would it be spec-compliant to just convert the value to an array with Array.from before passing it to the C++ side? It would also take care of potential errors thrown during iteration.
not entirely, but it's better than nothing. For example, something that isn't null and doesn't have a Symbol.iterator won't throw with Array.from, but spec-wise is expected to (Array.from(3) // []).
Activity
[-]structuredClone with custom iterator as transfer list causes Assertion `(index) < (length())' failed.[/-][+]MessagePort.postMessage with custom iterator as transfer list causes Assertion `(index) < (length())' failed.[/+]targos commentedon Oct 2, 2023
Would it be spec-compliant to just convert the value to an array with
Array.frombefore passing it to the C++ side? It would also take care of potential errors thrown during iteration.KhafraDev commentedon Oct 2, 2023
not entirely, but it's better than nothing. For example, something that isn't null and doesn't have a Symbol.iterator won't throw with Array.from, but spec-wise is expected to (
Array.from(3) // []).KhafraDev commentedon Oct 2, 2023
someone could use
node/lib/internal/crypto/webidl.js
Line 324 in 952cf0d
or maybe using
node/src/node_messaging.cc
Line 947 in 952cf0d