forked from aniani/vim
patch 7.4.1278
Problem: When jsonencode() fails it still returns something. Solution: Return an empty string on failure.
This commit is contained in:
@@ -75,6 +75,9 @@ func Test_encode()
|
||||
call assert_fails('echo jsonencode(function("tr"))', 'E474:')
|
||||
call assert_fails('echo jsonencode([function("tr")])', 'E474:')
|
||||
call assert_fails('echo jsonencode({"key":v:none})', 'E474:')
|
||||
|
||||
silent! let res = jsonencode(function("tr"))
|
||||
call assert_equal("", res)
|
||||
endfunc
|
||||
|
||||
func Test_decode()
|
||||
|
Reference in New Issue
Block a user