postcss / postcss-js

PostCSS for React Inline Styles, Free Style and other CSS-in-JS
MIT License
657 stars 25 forks source link

objectifier should be a pure function #38

Closed hcomnetworkers closed 5 years ago

hcomnetworkers commented 5 years ago

objectifier is manipulating the input node, this can cause problems when calling it multiple times.

In particular when !important declarations are included, multiple calls to objectify will yield different results because the child.value is mutated: https://github.com/postcss/postcss-js/blob/master/objectifier.js#L43

The objectifier should not have side effects.

ai commented 5 years ago

Fixed 3ba9103

ai commented 5 years ago

Released in 2.0.1