standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 146 forks source link

oom when js file contains zero width space unicode char #843

Open pimlie opened 4 years ago

pimlie commented 4 years ago

It seems somehow I inserted a zero width space character (U+200B) in one my javascript files which causes esm to hang until it consumed all memory and node exits with an out of memory error.

It should be reproducable by running node with this file: https://raw.githubusercontent.com/pimlie/nuxt-issues/master/test.js

The zero width space char is on the second line, run the file with node -r esm test.js