codalien / operator-overloading-js

Simple Operator overloading library for JS.
160 stars 26 forks source link

Assignment Operators are not working. #11

Closed Faleij closed 9 years ago

Faleij commented 9 years ago

While the test passes they are all wrong for the assignment operators. For example 'should overload += operator'

// test/tests.js #265
r += 33 + 22;
assertEqual(r, '33+33+22');

Should be

r += 33 + 22;
assertEqual(r, '33+22+=33');

as r += 33 + 22; should be interpretated as r = r.__addAssign(33..__plus(22));

I will be submitting a pull request for solving this after this issue is posted.