dollarshaveclub / postmate

📭 A powerful, simple, promise-based postMessage library.
MIT License
1.87k stars 184 forks source link

Problem with empty classListArray argument in IE 11 #207

Open c01nd01r opened 4 years ago

c01nd01r commented 4 years ago

Hi! I found a problem related to IE 11.

In IE 11, if element.classList.add() method does not receive arguments, the browser throws exception. Снимок экрана 2020-09-18 в 15 57 37

Similar behavior, when using the Function.prototype.apply() method Снимок экрана 2020-09-18 в 15 58 07

In the postmate source code there is also an section that causes a similar problem Снимок экрана 2020-09-18 в 16 09 04

I think it can be fixed by adding an extra check for classListArgs length of array. I have a prepared Pull Request that will refer to this issue.