avoid X-(-Y) in js optimizer; fixes #1685