Please sign in to comment.
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.
- Loading branch information...
Showing with 12 additions and 4 deletions.