Mercurial > vim
comparison src/json.c @ 23891:650070143c56 v8.2.2488
patch 8.2.2488: json_encode() gives generic argument error
Commit: https://github.com/vim/vim/commit/a853089479b60b829bab1c4a0a737a073415f8a7
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 8 21:53:09 2021 +0100
patch 8.2.2488: json_encode() gives generic argument error
Problem: json_encode() gives generic argument error.
Solution: Mention the type that can't be encoded. (issue https://github.com/vim/vim/issues/7802)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 08 Feb 2021 22:00:03 +0100 |
parents | 4dfd00f481fb |
children | a4fda40e0bb9 |
comparison
equal
deleted
inserted
replaced
23890:57c71d51e937 | 23891:650070143c56 |
---|---|
228 | 228 |
229 case VAR_FUNC: | 229 case VAR_FUNC: |
230 case VAR_PARTIAL: | 230 case VAR_PARTIAL: |
231 case VAR_JOB: | 231 case VAR_JOB: |
232 case VAR_CHANNEL: | 232 case VAR_CHANNEL: |
233 // no JSON equivalent TODO: better error | 233 semsg(_(e_cannot_json_encode_str), vartype_name(val->v_type)); |
234 emsg(_(e_invarg)); | |
235 return FAIL; | 234 return FAIL; |
236 | 235 |
237 case VAR_BLOB: | 236 case VAR_BLOB: |
238 b = val->vval.v_blob; | 237 b = val->vval.v_blob; |
239 if (b == NULL || b->bv_ga.ga_len == 0) | 238 if (b == NULL || b->bv_ga.ga_len == 0) |