New vector population when an object is supplied

// Populate a new vector with an existing item
var tab = DOpus.listers.lastactive.activetab;
var curItem = tab.files(0);
DOpus.output("curItem = "+curItem+", typeof curItem = "+typeof curItem);
var v = DOpus.Create().Vector(curItem); // Expected to add curItem
DOpus.output("v.count = "+v.count); // Apparently not
v.push_back(curItem); // Unless explicitly added with push_back
DOpus.output("v.count = "+v.count);

Results as shown below. This is with 12.24.5 Beta.

It's because the file/item object is technically a collection, so it's adding its elements, not the object itself.

It's best to avoid adding a single object via the creation method. This was vaguely implicit from the old docs, but we'll add an explicit warning against it:

If you want to create a Vector with just a single element, it is best to create an empty Vector and then add the element as a second step. Passing a single element during creation can have unexpected results, as it may be interpreted as one of the other cases. (Many of the scripting objects can be implicitly converted into integers or collections.)

I am surprised that the item object is "technically a collection". By definition, an item is an individual article or unit. However, as I discovered and as @Leo confirmed adding an object after defining an empty vector is a reliable solution.