Open ELLIOTTCABLE opened 11 years ago
To boot, there's literally no way of doing this in CoffeeScript (see: jashkenas/coffee-script#1693) that isn't half-a-line-long, as it compiles ==
into ===
, and provides no coercive operator at all.
This is completely unacceptable:
expect( (new String 'foo').valueOf() == 'foo' ).to.be.ok()
I agree. I just ran into this problem today and it's really unacceptable that CoffeeScript can't handle boxed type comparisons and also completely removed type coercion. At the very least, double equals in CoffeeScript should treat a new String as a 'string.'
Since threequality obviously doesn't cover boxed natives, I expected
.eql()
to do so, but it doesn't:Either
.eql()
should inherently support comparing boxed-types to natives, or we need a form of test that is directly equivalent to==
. At the moment, all I can do is the following, which is more than a little awkward: