sweet-js / sweet-core

Sweeten your JavaScript.
https://www.sweetjs.org
BSD 2-Clause "Simplified" License
4.58k stars 208 forks source link

Prevent operators from being recursively defined #675

Closed disnet closed 7 years ago

disnet commented 7 years ago

Custom operators were being recursively defined which caused:

operator + left 2 = (left, right) => {
  return #`${left} + ${right}`;
}

to go into an infinite loop. Not good, this PR fixes that.