Commit 67723088 authored by Trevor Norris's avatar Trevor Norris Committed by isaacs
Browse files

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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment