Open bartlomieju opened 2 weeks ago
This doesn't have anything to do with the serialize
function. Node.js doesn't provide a Float16Array
:
$ node -p "Float16Array"
[eval]:1
Float16Array
^
ReferenceError: Float16Array is not defined
Well, yeah, at the moment it doesn't. But once Float16Array
is added I think the support in node:v8
will follow?
As noted in https://github.com/nodejs/node/issues/52416#issuecomment-2043448555, support for Float16Array
is in-progress in V8. It's currently behind a --js-float16array
V8 runtime flag.
Hiya, Bartek.
maybe there's a chance we could agree that arrayBufferViewTypeToIndex will return 13 for the Float16Array?
Seems uncontroversial to me. The one thing is that arrayBufferViewIndexToType(13)
is going to fail with a "Float16Array is not defined" ReferenceError but everything else will work just fine though.
Hiya, Bartek.
maybe there's a chance we could agree that arrayBufferViewTypeToIndex will return 13 for the Float16Array?
Seems uncontroversial to me. The one thing is that
arrayBufferViewIndexToType(13)
is going to fail with a "Float16Array is not defined" ReferenceError but everything else will work just fine though.
Hey Ben, thanks for commenting. Should I open a PR that updates these function already? As you said they would fail with ReferenceError
s for now, but once Float16Array
support lands they would start working.
I guess we can update the functions and add the --js-float16array
flag in the test to validate it works.
Version
23.1.0
Platform
Subsystem
node:v8
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
serialize
calls finishes successfuly.What do you see instead?
Additional information
While I understand that
Float16Array
is not yet supported (eg. https://github.com/nodejs/node/issues/52416) as it requires upgrade to V8 12.4, maybe there's a chance we could agree thatarrayBufferViewTypeToIndex
will return13
for theFloat16Array
?https://github.com/nodejs/node/blob/5633c62219e199baac833e8862d60333d85dc3d3/lib/v8.js#L277-L293
Thanks!