An ObjC error leaks into the JS evaluation space if we evaluate the well-formed expression:
document.windows.selection.tasks.map( x => x.totalCost );
Cannot convert "0", type 13 to an NSAppleEventDescriptor
This is a fairly minor error for most practical purposes, as
x.totalCost.toString() works fine, but it does suggest some misalignment of types, or a leaky wrapper, at that point.