dcodeIO / long.js

A Long class for representing a 64-bit two's-complement integer value.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass object to constructor instead csv

sveip opened this issue · comments

commented

Is it possible add the possibility to do this:

var myLongObj = {low: 123, high: 123, unsigned: true};
var longVal = new Long(myLongObj);

instead of this:

var myLongObj = {low: 123, high: 123, unsigned: true};
var longVal = new Long(myLongObj.low, myLongObj.high, myLongObj.unsigned);

?

commented

There is Long.fromValue for that. I'd rather not add it to the constructor (which is called frequently) to save the additional assertions.

commented

I see. Thanks for the fast response and explanation.