ecmascript: Add item.addOptSeparator()

Fixes #2348