emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.35k stars 3.25k forks source link

Improve comment preservation in acorn-optimizer. NFC #22136

Closed sbc100 closed 5 days ago

sbc100 commented 6 days ago

Prior to this change we would drop any comment that was more than 20 characters from JS symbol, based on the end of the commend and that start of the symbol. This mean that all but the last single-line comments in a sequence would be dropped.

With this change we map all comments to the start of the next symbol. This means that we can have many comments in row that all map the same location and we decide to either keep all of them or discard them.

sbc100 commented 5 days ago

PIng..