summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Rojewski <krojew@users.noreply.github.com>2018-03-26 19:29:45 +0200
committerWouter van Oortmerssen <aardappel@gmail.com>2018-03-26 10:29:45 -0700
commitd3a00f77308cf5bb11d8eadcce9895e3f3399c62 (patch)
treec770703551d6e7ec88a7b8a3241e76d99aa584e0
parentcc54963830c4a30eef6ea3c366d478c643cb71d7 (diff)
downloadflatbuffers-d3a00f77308cf5bb11d8eadcce9895e3f3399c62.tar.gz
flatbuffers-d3a00f77308cf5bb11d8eadcce9895e3f3399c62.tar.bz2
flatbuffers-d3a00f77308cf5bb11d8eadcce9895e3f3399c62.zip
Fix for missing enum imports (#4683)
* 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 * Vector of unions for ts/js * Sanity check for languages * Indentation fix + output test files * Vectors of unions for php * Fixes to union vector handling + tests * Fix for strictPropertyInitialization * Fix for new aligned operator new for gcc >= 7.1 * Not generating imports/ns prefixes with --gen-all * TypeScript docs * Missing imports of enums
-rw-r--r--src/idl_gen_js.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/idl_gen_js.cpp b/src/idl_gen_js.cpp
index 5cd3a0fe..c0844d4e 100644
--- a/src/idl_gen_js.cpp
+++ b/src/idl_gen_js.cpp
@@ -679,6 +679,10 @@ class JsGenerator : public BaseGenerator {
GenPrefixedTypeName(GenTypeName(field.value.type, false, true),
field.value.type.enum_def->file) +
" {\n";
+
+ if (!parser_.opts.generate_all) {
+ imported_files.insert(field.value.type.enum_def->file);
+ }
} else {
code += "):" + GenTypeName(field.value.type, false, true) + " {\n";
}