thriftrw / thriftrw-node

A thrift binary encoding library using bufrw
MIT License
57 stars 25 forks source link

Proposal: I64DateRW should accept array/buffer input #110

Closed Willyham closed 8 years ago

Willyham commented 8 years ago

Right now, I64RW accepts buffers, arrays, numbers, strings and {hi, lo} objects. I64DateRW on the other hand only accepts number, strings and dates.

At the very least, passing anything other than number, string or date should throw. Right now, passing an array results in a date at the epoch (because Long.fromNumber(NaN) gives lo/hi = 0).

This is causing confusion when passing dates between services which use the date annotation and services which do not.