Commit 7cc72e4b authored by Kamil Rojewski's avatar Kamil Rojewski Committed by Wouter van Oortmerssen

Copying required field to union type vector (#4407)

* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes

* Generating the most strict TS code possible

* Not returning null when creating vectors

* Not returning null from struct contructors

* Copying required field to union type vector

* Removed unneccessary bool
parent a6a3f592
...@@ -745,6 +745,10 @@ CheckedError Parser::ParseField(StructDef &struct_def) { ...@@ -745,6 +745,10 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
} }
if (typefield) { if (typefield) {
if (!IsScalar(typefield->value.type.base_type)) {
// this is a union vector field
typefield->required = field->required;
}
// If this field is a union, and it has a manually assigned id, // If this field is a union, and it has a manually assigned id,
// the automatically added type field should have an id as well (of N - 1). // the automatically added type field should have an id as well (of N - 1).
auto attr = field->attributes.Lookup("id"); auto attr = field->attributes.Lookup("id");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment