Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected output and possible memory leak #35

Open
Ravenstine opened this issue Sep 4, 2021 · 1 comment
Open

Unexpected output and possible memory leak #35

Ravenstine opened this issue Sep 4, 2021 · 1 comment
Labels
bug report Something isn't working

Comments

@Ravenstine
Copy link

It seems strange for these functions to be maintaining state and producing output that isn't expected from the given input.

For instance, manipulation of a string value results in the original input code when printed:

Screen Shot 2021-09-04 at 10 59 29 AM

It appears that code is being kept in memory with seemingly no way to clear it and the span ranges used for each node are simply incremented:

Screen Shot 2021-09-04 at 11 00 00 AM

So the only way I've figured out to properly print a manipulated AST is to manually increment all the start & end values:

Screen Shot 2021-09-04 at 11 21 08 AM

Is this expected? I'm seeing this using deno 1.13.0.

@littledivy littledivy added the bug report Something isn't working label Sep 5, 2021
@chrisdevereux
Copy link

Same here. I don't know the internals of swc at all, but wonder if this is related to the compiler instance being cached in swc_wasm/lib.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants