mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
Fix handling of +/-inf defaults in TS/rust/go/dart codegen (#7588)
+/-inf were not being handled, and so invalid typescript was being generated when a float/double had an infinite default value. NaN was being handled correctly. Co-authored-by: Derek Bailey <derekbailey@google.com> Co-authored-by: Casper <casperneo@uchicago.edu>
This commit is contained in:
@@ -266,10 +266,14 @@ void MiniReflectFlatBuffersTest(uint8_t *flatbuf) {
|
||||
"}, "
|
||||
"{ name: \"Wilma\" } ], "
|
||||
// TODO(wvo): should really print this nested buffer correctly.
|
||||
"testnestedflatbuffer: [ 20, 0, 0, 0, 77, 79, 78, 83, 12, 0, 12, 0, 0, "
|
||||
"0, "
|
||||
"4, 0, 6, 0, 8, 0, 12, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 13, 0, 0, 0, 78, "
|
||||
"101, 115, 116, 101, 100, 77, 111, 110, 115, 116, 101, 114, 0, 0, 0 ], "
|
||||
"testnestedflatbuffer: [ 124, 0, 0, 0, 77, 79, 78, 83, 0, 0, 114, 0, 16, "
|
||||
"0, 0, 0, 4, 0, 6, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
|
||||
"0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
|
||||
"0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
|
||||
"0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
|
||||
"0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 114, 0, 0, 0, 0, 0, 0, 0, "
|
||||
"8, 0, 0, 0, 0, 0, 192, 127, 13, 0, 0, 0, 78, 101, 115, 116, 101, 100, "
|
||||
"77, 111, 110, 115, 116, 101, 114, 0, 0, 0 ], "
|
||||
"testarrayofstring2: [ \"jane\", \"mary\" ], "
|
||||
"testarrayofsortedstruct: [ { id: 0, distance: 0 }, "
|
||||
"{ id: 2, distance: 20 }, { id: 3, distance: 30 }, "
|
||||
@@ -277,7 +281,8 @@ void MiniReflectFlatBuffersTest(uint8_t *flatbuf) {
|
||||
"flex: [ 210, 4, 5, 2 ], "
|
||||
"test5: [ { a: 10, b: 20 }, { a: 30, b: 40 } ], "
|
||||
"vector_of_enums: [ Blue, Green ], "
|
||||
"scalar_key_sorted_tables: [ { id: \"miss\" } ] "
|
||||
"scalar_key_sorted_tables: [ { id: \"miss\" } ], "
|
||||
"nan_default: nan "
|
||||
"}");
|
||||
|
||||
Test test(16, 32);
|
||||
@@ -317,4 +322,4 @@ void MiniReflectFixedLengthArrayTest() {
|
||||
}
|
||||
|
||||
} // namespace tests
|
||||
} // namespace flatbuffers
|
||||
} // namespace flatbuffers
|
||||
|
||||
Reference in New Issue
Block a user