[TS/JS] Add support for creating vectors from typed arrays#6446
Closed
ptitjes wants to merge 3 commits intogoogle:masterfrom
Closed
[TS/JS] Add support for creating vectors from typed arrays#6446ptitjes wants to merge 3 commits intogoogle:masterfrom
ptitjes wants to merge 3 commits intogoogle:masterfrom
Conversation
This commit add support for creating vectors directly from in-memory JavaScript typed arrays (Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array and Float64Array). There was already support for reading directly to typed arrays. This brings the counterpart for writing. This commit also removes the invalid Uint8Array overloads. These overloads were invalid as they enabled a TypeScript user to pass a Uint8Array to the generated methods which were in turn iterating on the array content as if they were normal numbers. Summary of changes: * add support for typed array factory methods in builder.ts * add corresponding support in idl_gen_ts.cpp * remove invalid Uint8Array overloads in idl_gen_ts.cpp
Author
|
@krojew Would you mind helping me make my two PRs pass the CIs ? I think the problems come from the generated files. |
Collaborator
Collaborator
Contributor
|
Sorry for not responding, but I have almost no free time at the moment. |
Contributor
|
This pull request is stale because it has been open 6 months with no activity. Please comment or this will be closed in 14 days. |
Author
|
I will update this PR soon. |
Collaborator
|
@ptitjes Any plans to continue this? Otherwise I will mark it closed. |
Collaborator
|
Please reopen if you would like to continue this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This commit add support for creating vectors directly from in-memory JavaScript typed arrays (
Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32ArrayandFloat64Array).There was already support for reading directly to typed arrays. This brings the counterpart for writing.
This commit also removes the invalid
Uint8Arrayoverloads. These overloads were invalid as they enabled a TypeScript user to pass aUint8Arrayto the generated methods which were in turn iterating on the array content as if they were normal numbers.Summary of changes:
builder.tsidl_gen_ts.cppUint8Arrayoverloads inidl_gen_ts.cppThis PR is based on #6445 which fixed a code gen bug after #6420.