1
0
forked from aniani/vim

patch 8.0.0166: JSON with a duplicate key gives an internal error

Problem:    JSON with a duplicate key gives an internal error. (Lcd)
Solution:   Give a normal error.  Avoid an error when parsing JSON from a
            remote client fails.
This commit is contained in:
Bram Moolenaar
2017-01-10 15:15:37 +01:00
parent f446b48ff0
commit 03c60c1573
5 changed files with 36 additions and 5 deletions

View File

@@ -148,8 +148,9 @@ func Test_json_decode()
call assert_fails('call json_decode("\"")', "E474:")
call assert_fails('call json_decode("blah")', "E474:")
call assert_fails('call json_decode("true blah")', "E474:")
call assert_fails('call json_decode("true blah")', "E488:")
call assert_fails('call json_decode("<foobar>")', "E474:")
call assert_fails('call json_decode("{\"a\":1,\"a\":2}")', "E937:")
call assert_fails('call json_decode("{")', "E474:")
call assert_fails('call json_decode("{foobar}")', "E474:")