31 Commits

Author SHA1 Message Date
Jason Pickens
1d3c02a89e
fix: scope variable for map field to avoid redeclaration (#1717) (#1718)
Co-authored-by: Alexander Fenster <fenster@google.com>
2022-07-06 19:15:36 -07:00
Matthias Schiffer
b950877c86
fix: handling of map entries with omitted key or value (#1348)
According to [1], map encoding must be compatible with a repeated message
using indices 1 and 2 for key and value. In particular this implies that
both key and value may be omitted when they are equal to the default
value - which some protobuf implementations like protobuf-c actually do.

The comments in the added testcase are based on the output of
protobuf-inspector [2].

[1] https://developers.google.com/protocol-buffers/docs/proto3#backwards-compatibility
[2] https://github.com/jmendeth/protobuf-inspector

Based-on-patch-by: Shrimpz <Shrimpz@qq.com>

Co-authored-by: Alexander Fenster <fenster@google.com>
2020-07-10 15:52:56 -07:00
dcodeIO
3f8b74ba67 Other: codegen 2 performance pass, #653 might benefit 2017-04-24 00:26:28 +02:00
dcodeIO
17c2797592 New: Upgrade to codegen 2 2017-04-23 14:51:58 +02:00
dcodeIO
3a20968c6d Other: Properly remove unnecessary (packed) options from JSON descriptors 2017-04-13 19:12:45 +02:00
dcodeIO
fff1eb297a Other: Coverage for util.isset and service as a namespace 2017-03-25 23:20:52 +01:00
dcodeIO
8d9981588d CLI: Check upfront if key-var is required in static decoders with maps, see #726 2017-03-24 17:39:15 +01:00
dcodeIO
270cc94c7c Other: General cleanup + regenerated dist/test files 2017-03-23 03:20:56 +01:00
dcodeIO
4b49f500fc Other: Trying out a more aggressive aproach for custom error subclasses 2017-03-11 06:25:59 +01:00
dcodeIO
26d9fadb21 New: decode throws specific ProtocolError with a reference to the so far decoded message if required fields are missing + example 2017-03-06 03:31:51 +01:00
dcodeIO
e7e123aa0b Other: Cache any regexp instance (perf); Docs: Documented throwing behavior of Reader.create and Message.decode 2017-03-05 23:08:53 +01:00
dcodeIO
44a8d3af5d Breaking: Decoder now throws if required fields are missing, see #695 / #696 2017-03-05 22:58:09 +01:00
dcodeIO
dd96dcdacb Other: Various other minor improvements / assertions refactored away, see #653 2017-01-24 05:05:26 +01:00
dcodeIO
799d0303bf Other: In fromObject, check if object is already a runtime message, see #652 2017-01-19 23:24:19 +01:00
dcodeIO
32e0529387 Other: Cleaned and categorized tests, coverage progress 2017-01-17 05:08:15 +01:00
dcodeIO
818bcacde2 Other: Slightly hardened codegen sprintf; Other: Significantly improved uint32 write performance 2017-01-16 23:29:24 +01:00
dcodeIO
d2a97bb818 Docs: Documented internally used codegen partials for what it's worth 2017-01-12 18:05:23 +01:00
dcodeIO
fe4d97bbc4 Moved TS-compatible Namespace features to a virtual NamespaceBase class, compiles with strictNullChecks by default now, see #635; Docs: Added SVG logo, see #629; Other: Minor codegen enhancements 2017-01-10 16:48:27 +01:00
dcodeIO
c2c39fc7ce Fixed: Fixed invalid definition of Field#packed property, also introduced decoder.compat mode (packed fields, on by default) 2017-01-06 01:11:56 +01:00
dcodeIO
11fb1a66ae Fixed: Always decode packed/non-packed based on wire format only, see #602 2017-01-06 00:56:07 +01:00
dcodeIO
8ba3c5efd1 Other: Removed some unused utility, slightly more efficient codegen, additional comments 2017-01-05 15:51:49 +01:00
dcodeIO
a017bf8a2d Breaking: Dropped IE8 support; New: Converters use code generation and support custom implementations; CLI: Generated static code now supports asJSON/from 2017-01-02 05:46:27 +01:00
dcodeIO
1e0ebc064e Other: And fixed IE8 again (should probably just drop IE8 for good) 2016-12-27 13:47:46 +01:00
dcodeIO
61fd385674 Other: Various minor improvements and coverage progress 2016-12-26 18:58:17 +01:00
dcodeIO
ab3e236a96 Docs: Added static/JSON module interchangeability to README; Minor optimizations through providing type-hints; Performance: Reverted shortened switch statements in verifier; Compatibility: Enums can't be map key types 2016-12-20 01:38:22 +01:00
dcodeIO
bfac0ea9af Stripped out fallback encoder/decoder/verifier completely (even IE8 supports codegen), significantly reduces bundle size, can use static codegen elsewhere 2016-12-18 13:59:52 +01:00
dcodeIO
7c3bf8d32c Refactored codegen, put frozen objects on the prototype, see #526; Trying out jsdoc variations, see #527 2016-12-07 20:29:00 +01:00
dcodeIO
a46cc4934b Removed as-function overload for Reader/Writer, profiler stub, optimized version of Reader#int32 2016-12-06 15:04:29 +01:00
dcodeIO
5785dee15d Restructured encoder / decoder to better support static code gen 2016-12-01 16:55:30 +01:00
dcodeIO
9a762e4e58 Support for IE8 / non-ES5 2016-11-28 16:10:16 +01:00
dcodeIO
26ba0bb1ab Fresh master without docs 2016-11-26 11:53:06 +01:00