Commit Graph

12 Commits

Author SHA1 Message Date
kostya-sh 76d31e1b5e Go - Use Go bool type for bool fields (#4962)
* Use Go bool type for bool fields, and store non-default bool field to test data
2018-10-15 16:55:59 -07:00
Kamil Rojewski 808b44f87a TS tests fixes (#4265)
* 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
2017-04-21 09:29:42 -07:00
litianzhao ebcfbbadf0 fix #4180: Long.prototype.toFloat64() overflow (#4182) 2017-02-20 11:20:56 -08:00
Michael Paulson d268d11ca2 feat(test): Added mutation testing for scalar values.
This is a port of the tests found in test.cpp
2016-07-27 13:32:53 -07:00
Wouter van Oortmerssen 617fedf349 Merge pull request #3765 from Mischanix/js-typed-arrays
Javascript helper to get typed array views
2016-02-26 09:51:50 -08:00
Evan Wallace 31b30335f6 Fix #3773: Generated JS now avoids the flatbuffers object 2016-02-25 01:06:16 -08:00
Robert Nix 9d92aeb182 Add helper for javascript typed arrays
For scalar vector fields, emit an Array helper that
returns a typed array view of the underlying bytes buffer.
2016-02-12 12:41:28 -06:00
Robert Nix 2f5d7ae645 Fix javascript unicode test
The generated buffer should be tested for semantic equivalence
to the correct buffer, instead of being tested for bytewise
equality.
2016-02-12 12:31:25 -06:00
Evan Wallace 4bef5e89c4 Add UTF-8 support to the JavaScript API
This adds an optional argument to generated getters for string fields to
specify the encoding type and overloads the createString() function. It's
now possible to use either JavaScript UTF-16 string objects or C-style
UTF-8 byte arrays (Uint8Array) for string data.
2015-10-14 23:07:40 -07:00
Evan Wallace e1e8d53df6 Add low-level fuzzer, fix 64-bit issue it found 2015-10-14 21:15:57 -07:00
Evan Wallace 57a6dd472f Add a test for JavaScript UTF-8 <=> UTF-16 conversion
JavaScript uses UTF-16 but FlatBuffers uses UTF-8. This commit tests the code
that does the conversion between the two encodings. The last entry in the array
is tricky because each code point actually requires two UTF-16 code units,
unlike the other examples. The current JSON output of flatc actually handles
this case incorrectly (it generates invalid JSON with UTF-8 code units). The
generated JavaScript code passes these tests fine, however.
2015-10-14 21:15:57 -07:00
Evan Wallace 224e33ed09 Add support for JavaScript code generation
This adds a JavaScript language target. The generated JavaScript uses Google
Closure Compiler type annotations and can be compiled using the advanced
compilation mode, which performs type checking and optimizations such as
inlining and dead code elimination. The generated JavaScript also exports all
generated symbols for use with Node.js and RequireJS. This export behavior
can be turned off with the --no-js-exports flag for use with Google Closure
Compiler.
2015-10-14 21:15:57 -07:00