resolver script checking no value of attribute; .length vs size()

Cantor, Scott cantor.2 at osu.edu
Mon Apr 25 20:52:50 UTC 2022


>    A colleague smartly told me to replace .size() with .length, which does in fact work without triggering the
> error.

I don't believe length is even defined for Collection or List. I use size (testing > 0) and have never had a problem, but admittedly I use Rhino. And the size() method is defined as "number of elements in the list".

If you're actually saying "length" with no parentheses, pretty sure you're getting some random Javascript thing back, I didn't think Javascript auto-forwarded property names to method calls like Velocity does.

-- Scott




More information about the users mailing list