FR: Provide the remainder of the comparison operators for juce::var


#1

Hey folks, I’m presently working on extending JUCE’s Javascript interpreter (more for the fun of it and learning the language).

It looks like juce::var is missing the operators <, <=, >, and >=. Implementing them should be mostly straightforward I think? It would also jive better with C++'s equivalent std::variant.

From my understanding from poking around the ECMA script standard and looking at duktape (a nearly fully compliant JS interpreter that’s open source), basically in circumstances that don’t make sense to compare you have to return undefined.


#2

Yes, good request, didn’t realise they were missing - I’ll add that!


#3

Has this been added yet?


#4

Yeah, Jules did it soon after the request: https://github.com/WeAreROLI/JUCE/commit/76c94e2c10bfde84243b6e22b366f3bdfd457356


#5

Perfect, thank you!