Comment 20 for bug 486284

Revision history for this message
In , Dolske (dolske) wrote :

(From update of attachment 389264)
>+ if (aField && aField.maxLength > -1)
>+ result.wrappedJSObject.entries = result.wrappedJSObject.entries.filter(this._filterEntryLength, aField);

Use an inline anonymous function here...

foo = foo.filter(function (e) { return (element.text.length <= this.maxLength) });

(A refinement of having a local function in the if-block to do this, which would be my choice instead of having a tiny utility function stuck, at distance, onto the component's object).