babel/packages/babel-traverse
Nicolò Ribaudo 0345c1bc1d
Use for..of Object.keys instead of for..in (#9518)
In https://github.com/babel/babel/issues/9511 (and #9495 is another symptom), @PavelKastornyy reported a node crash becaue the JavaScript heap run out of memory. The problem was that their code was adding enumerable properties to `Object.prototype`: it is something that shouldn't be done, but Babel shouldn't make node crash if someone adds them.
I reduced down the problem to `for...in` loops in `@babel/traverse` that grew the memory consumption exponentially because of that unexpected properties.
2019-02-26 20:09:02 +01:00
..
2017-03-25 21:46:16 -04:00
2019-02-25 19:29:12 +01:00

@babel/traverse

The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes

See our website @babel/traverse for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/traverse

or using yarn:

yarn add @babel/traverse --dev