Commit 57ed3dae authored by Trevor Norris's avatar Trevor Norris
Browse files

buffer: fix and cleanup fill()

Running fill() with an empty string would cause Node to hang
indefinitely. Now it will return without having operated on the buffer.

User facing function has been pulled into JS to perform all initial
value checks and coercions. The C++ method has been placed on the
"internal" object.

Coerced non-string values to numbers to match v0.10 support.

Simplified logic and changed a couple variable names.

Added tests for fill() and moved them all to the beginning of
buffer-test.js since many other tests depend on fill() working properly.

Fixes: https://github.com/joyent/node/issues/8469


Signed-off-by: default avatarTrevor Norris <trev.norris@gmail.com>
parent f2a78de6
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