Browse Source

Minor JSON improvements

* Add 'json' to function names for consistency, e.g. duk__dec_xxx() to
  duk__json_dec_xxx().

* Remove 'JSON' from recursion limit error messages, it is usually
  apparent from the context and can be shared by CBOR encode/decode.
pull/2340/head
Sami Vaarala 4 years ago
parent
commit
57d5c2cf31
  1. 357
      src-input/duk_bi_json.c
  2. 6
      src-input/duk_strings.h

357
src-input/duk_bi_json.c

File diff suppressed because it is too large

6
src-input/duk_strings.h

@ -77,10 +77,12 @@
/* JSON */ /* JSON */
#define DUK_STR_FMT_PTR "%p" #define DUK_STR_FMT_PTR "%p"
#define DUK_STR_FMT_INVALID_JSON "invalid json (at offset %ld)" #define DUK_STR_FMT_INVALID_JSON "invalid json (at offset %ld)"
#define DUK_STR_JSONDEC_RECLIMIT "json decode recursion limit"
#define DUK_STR_JSONENC_RECLIMIT "json encode recursion limit"
#define DUK_STR_CYCLIC_INPUT "cyclic input" #define DUK_STR_CYCLIC_INPUT "cyclic input"
/* Generic codec */
#define DUK_STR_DEC_RECLIMIT "decode recursion limit"
#define DUK_STR_ENC_RECLIMIT "encode recursion limit"
/* Object property access */ /* Object property access */
#define DUK_STR_INVALID_BASE "invalid base value" #define DUK_STR_INVALID_BASE "invalid base value"
#define DUK_STR_STRICT_CALLER_READ "cannot read strict 'caller'" #define DUK_STR_STRICT_CALLER_READ "cannot read strict 'caller'"

Loading…
Cancel
Save