-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object API packs arrays of structs in reverse order [TS, master] #7021
Comments
@krojew do you want to take a look? |
@AndyCampbellNvidia Would you want to make a PR that fixes this? Ideally it would be the code gen that changes, but you could also edit |
…google#7021) * Typescript / Javascript don't have fixed arrays but it is important to support for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to schema
…google#7021) * Typescript / Javascript don't have fixed arrays but it is important to support for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to schema
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
#7581) * [TS] Add support for fixed length arrays on Typescript (#5864) (#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * Formatting & readability fixes on idl_gen_ts.cpp Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * Added array_test_complex.bfbs Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * TS arrays_test_complex: Remove bfbs and use fbs directly Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
This issue is stale because it has been open 6 months with no activity. Please comment or label |
This issue was automatically closed due to no activity for 6 months plus the 14 day notice period. |
…oogle#7021) (google#7581) * [TS] Add support for fixed length arrays on Typescript (google#5864) (google#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * Formatting & readability fixes on idl_gen_ts.cpp Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * Added array_test_complex.bfbs Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * TS arrays_test_complex: Remove bfbs and use fbs directly Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
…oogle#7021) (google#7581) * [TS] Add support for fixed length arrays on Typescript (google#5864) (google#7021) * Typescript / Javascript don't have fixed arrays but it is important to support these languages for compatibility. * Generated TS code checks the length of the given array and do truncating / padding to conform to the schema. * Supports the both standard API and Object Based API. * Added a test. Co-authored-by: Mehmet Baker <mehmet.baker@zerodensity.tv> Signed-off-by: Bulent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * Formatting & readability fixes on idl_gen_ts.cpp Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * Added array_test_complex.bfbs Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> * TS arrays_test_complex: Remove bfbs and use fbs directly Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv> Signed-off-by: Bülent Vural <bulent.vural@zerodensity.tv>
Generated TypeScript code in object-model API mostly does array reversal automatically to handle the backwards insertion order when packing, but for arrays-of-structs it does not.
Calls are generated to
builder.createStructOffsetList
with no reversal wrappers, and the function doesn't do any reversal logic internally.The unit test code which should catch this failure is flawed, and does not verify correct ordering after pack/unpack round-trip (summing array elements is commutative):
https://github.com/google/flatbuffers/blob/master/tests/JavaScriptTest.js#L168
The text was updated successfully, but these errors were encountered: