Open kuldeepdhaka opened 8 years ago
Ya good point we should deprecate the parameter with a warning and then remove it in the next major version.
PR welcome.
probebly removing offset
is a good idea.
also, offset can be applied using Buffer.slice (which uses TypedArray subarray())
BUT adding offset and NULL checking style is used through out the c++ code.
better is to remove from everywhere. (present in ReadObject
, ReadPointer
, ReadInt64
, ReadUInt64
, ReadCString
also)
This would require considerable api change
https://github.com/TooTallNate/ref/blob/master/src/binding.cc#L514
if
offset > 0
then checkingptr == NULL
will not match even ifBuffer::Data(buf.As<Object>())
returnNULL
etiher checking is useless or we need to check for NULL before adding offset.