Fix global destructor injection for JS backend (#19797)

* 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>
This commit is contained in:
quantimnot 2022-05-23 00:17:32 -04:00 • committed by GitHub
commit 05c0419658
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 6 deletions

View file

@ -1,5 +1,6 @@
discard """
matrix: "--gc:refc; --gc:arc"
matrix: "--mm:refc; --mm:arc"
targets: "c js"
output: '''
1
2