[backport:1.4] JS cstring null fixes (#16979)
* [backport:1.4] JS cstring null fixes * fix JS move string * make it look cleaner
This commit is contained in:
parent
f3c39bf2d9
commit
81533a0014
5 changed files with 69 additions and 8 deletions
|
|
@ -14,4 +14,12 @@ block:
|
|||
var x = "foo".cstring
|
||||
var y: string
|
||||
add(y, x)
|
||||
doAssert y == "foo"
|
||||
doAssert y == "foo"
|
||||
|
||||
block:
|
||||
type Foo = object
|
||||
a: string
|
||||
var foo = Foo(a: "foo")
|
||||
var y = move foo.a
|
||||
doAssert foo.a.len == 0
|
||||
doAssert y == "foo"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue