Re:Binary File Parsing revisited using Javascript
by spacejunkie on Thursday August 18, 2011 @10:57PM
(#2902046)
It seems that this library relies on hash keys being returned in the same order that they appear in a literal hash constructor. I.e., if var x = { "b":3, "a":10 }, then for (n in x) will _always_ assign n to "b" first before assigning it to "a".
Is this something that is guaranteed by javascript?
It seems that the seek & tell example from this blog post could mostly be implemented in bindat through the mere datatype definitions, as they allow for variable length sequences and for skip operations.
Re:Binary File Parsing revisited using Javascript
by vjeux on Thursday August 18, 2011 @11:13PM
(#2902083)
I haven't see much int64 in the binary files I've been working on so far. Do you have any examples?
It is possible to make an Integer64 class, the downside is the lack of ability to overload default operators such as +, *, < ... That is annoying but not deal-breaking
Is this something that is guaranteed by javascript?
See this bug report for more lengthy details http://code.google.com/p/v8/issues/detail?id=164
In theory? No. In practice? ... Still no, if you use delete.
https://developer.mozilla.org/en/JavaScript/Reference/Operat...
It seems that the seek & tell example from this blog post could mostly be implemented in bindat through the mere datatype definitions, as they allow for variable length sequences and for skip operations.
It is possible to make an Integer64 class, the downside is the lack of ability to overload default operators such as +, *, < ... That is annoying but not deal-breaking