Closed antris closed 12 years ago
That's really interesting, mine is passing fine:
$ npm test
> bilby@0.0.0 test bilby.js
> ./node_modules/grunt/bin/grunt test
Running "test:src" (test) task
Testing features.js.......OK
>> 9 assertions passed (4ms)
Done, without errors.
What version of node.js/grunt are you using?
bilby.js(tests): node --version
v0.6.19
bilby.js(tests): grunt --version
grunt v0.3.15
I've had a look at this and have no idea. Passes just fine locally with node v0.6.12 and grunt 0.3.15. Not sure why only the functor test would fail - works exactly the same way as the other tests.
Ah, so in node.js 0.6.19 I get this behaviour:
> {valueOf: function() { console.log('a'); }} > {valueOf: function() { console.log('b'); }}
b
a
false
Notice the order? Interesting that it's only a problem with >
. Ordering might be an implementation detail - but maybe I should just change symbol :bulb:
Specification says it should go left to right. Was a bug in V8. Guess I'll change the symbol to something that hasn't had a bug.
Changed functor syntax from >
to <
.
Haha, wow. #wtfjs
@pufuwozu: I'd be very interested to see that bug report. Can we get a link?
@michaelficarra found it:
From the V8 issue, there might be an issue with Safari's >=
. Need to check.
Safari 6:
({valueOf: function() { console.log('a'); }}) >= ({valueOf: function() { console.log('b'); }})
a
b
false
As mentioned in the pull request for adding tests (#1), the functor test is failing: