Changes to make flatbuffers javascript compatible with the closure compiler.

Change-Id: Iab8d66a8f34910029deb8a5ff5ec7ba50c5b3421
This commit is contained in:
Wouter van Oortmerssen
2017-02-08 17:08:47 -08:00
parent 60b11435e6
commit d7ba17dfe5
5 changed files with 76 additions and 4 deletions

View File

@@ -86,6 +86,8 @@ std::string FlatCompiler::GetUsageString(const char* program_name) const {
" --escape-proto-ids Disable appending '_' in namespaces names.\n"
" --gen-object-api Generate an additional object-based API.\n"
" --cpp-ptr-type T Set object API pointer type (default std::unique_ptr)\n"
" --no-js-exports Removes Node.js style export lines in JS.\n"
" --goog-js-export Uses goog.exports* for closure compiler exporting in JS.\n"
" --raw-binary Allow binaries without file_indentifier to be read.\n"
" This may crash flatc given a mismatched schema.\n"
" --proto Input is a .proto, translate to .fbs.\n"
@@ -146,6 +148,8 @@ int FlatCompiler::Compile(int argc, const char** argv) {
opts.allow_non_utf8 = true;
} else if(arg == "--no-js-exports") {
opts.skip_js_exports = true;
} else if(arg == "--goog-js-export") {
opts.use_goog_js_export_format = true;
} else if(arg == "--defaults-json") {
opts.output_default_scalars_in_json = true;
} else if (arg == "--unknown-json") {