mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-05 04:27:44 +00:00
* Fix global destructor injection for JS backend * Moved global destructors injection before the final call to transform and generate JS code. It had previously been after and thus not no JS was generated for them. * Added some internal documentation of `jsgen`. * Enable a current destructor test to cover the JS backend as well. * Fixes the JS aspect of #17237. * Fixed global destructor injection order for JS backend Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
24 lines
268 B
Nim
24 lines
268 B
Nim
discard """
|
|
matrix: "--mm:refc; --mm:arc"
|
|
targets: "c js"
|
|
output: '''
|
|
1
|
|
2
|
|
here
|
|
2
|
|
1
|
|
'''
|
|
"""
|
|
|
|
|
|
type
|
|
A = object
|
|
id: int
|
|
B = object
|
|
a: A
|
|
proc `=destroy`(a: var A) = echo a.id
|
|
var x = A(id: 1)
|
|
var y = B(a: A(id: 2))
|
|
`=destroy`(x)
|
|
`=destroy`(y)
|
|
echo "here" |