You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i am stringifying an AST that is ES-Tree compliant, the locations (through "loc" property) works but the sources are not matching. The "loc" property also has a nested property called "source" which is a string. When the AST is being generated, astring uses the generated file name inside "file" property inside the sourcemap instead of checking the "source" property inside the "loc" object.
Motivation
When i am stringifying an AST that is ES-Tree compliant, the locations (through "loc" property) works but the sources are not matching. The "loc" property also has a nested property called "source" which is a string. When the AST is being generated, astring uses the generated file name inside "file" property inside the sourcemap instead of checking the "source" property inside the "loc" object.
Expected behavior
Testing AST:
Expected SourceMap:
Actual behavior
astring does not use the source names inside the loc property and so it makes the sourcemap incorrect.
This is the result of actual behavior:
Fix:
Literally just add
mapping.source = node.loc.source;
toastring.js at new line 1164
. I've already created a small pull request for this: #732The text was updated successfully, but these errors were encountered: