Once a descriptor is complete (all its references have been resolved), its details' actual value arrays are no
longer needed to build the descriptor further - clear them to save memory, unless keepValues says otherwise.
Parameters
descriptor: descriptor
The descriptor to check.
keepValues: boolean = false
Set true to keep the values even once the descriptor is complete.
Returns descriptor
The same descriptor, with details[].value cleared if applicable.
Once a descriptor is complete (all its references have been resolved), its details' actual
valuearrays are no longer needed to build the descriptor further - clear them to save memory, unlesskeepValuessays otherwise.