0
0
mirror of https://github.com/vim/vim.git synced 2025-10-08 06:04:08 -04:00

patch 9.0.1058: string value of class and object do not have information

Problem:    String value of class and object do not have useful information.
Solution:   Add the class name and for the object the member values.
This commit is contained in:
Bram Moolenaar
2022-12-14 17:30:37 +00:00
parent 70ef3f546b
commit 91c9d6d772
3 changed files with 52 additions and 5 deletions

View File

@@ -283,6 +283,21 @@ def Test_class_object_member_inits()
v9.CheckScriptFailure(lines, 'E1330:')
enddef
def Test_class_object_to_string()
var lines =<< trim END
vim9script
class TextPosition
this.lnum = 1
this.col = 22
endclass
assert_equal("class TextPosition", string(TextPosition))
var pos = TextPosition.new()
assert_equal("object of TextPosition {lnum: 1, col: 22}", string(pos))
END
v9.CheckScriptSuccess(lines)
enddef
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker