buffer: Don't double-negate numeric buffer arg
Fix #4331 Using double negate forces values into 32bit space. Because of this Math.ceil needs to be used. Since NaN comparisons are always false, use that to our advantage to return 0 if it is. Also added two tests to verify the changes.
parent
acad8d9a
Please register or sign in to comment