vjeux/jDataView — pull request #24 by Mithgol (2012-08-08 06:56:45+00:00)
Title: No intrinsic endianness

* Fixes #22. May bring some performance gain because `if (littleEndian === undefined)` checkpoints are mostly eliminated.
* For jParser methods to stay little-endian, the commit Mithgol/jParser@996a428ec4af5436d9705cdaf5d4248d9ed48ba2 (and its bugfix Mithgol/jParser@c3cbba897525f25d526ad81a53858369f8780199) is necessary. They are included in the corresponding pull request, vjeux/jParser#1.
* You may wish to introduce their big-endian counterparts with a commit such as pauldub/jParser@fbe32eb87206dbefcf4db98f2274c40bfba81f31 (but with `false` instead of `true`).

* The value of `name` is generated in runtime (as far as I understand, it must depend on `littleEndian` argument passed to the method, not to the constructor):

```javascript
var name;
if (type === 'Int8' || type === 'Uint8') {
name = 'read' + nodeNaming[type];
} else if (littleEndian) {
name = 'read' + nodeNaming[type] + 'LE';
} else {
name = 'read' + nodeNaming[type] + 'BE';
}
```

* `ArrayBuffer`-based implementation checks for `typeof global === 'undefined'` and uses `window` instead of `global` if necessary. (May happen in some of the browsers.)