The pattern of doing TO_INTEGER and then testing for negative now occurs all
over the place. Would it make sense to keep TO_POSITIVE_INTEGER as an
abstraction and just change its implementation accordingly?
https://codereview.chromium.org/17572009/diff/2001/src/arraybuffer.js
File src/arraybuffer.js (right):
https://codereview.chromium.org/17572009/diff/2001/src/arraybuffer.js#newcode36
src/arraybuffer.js:36: var byteLength = IS_UNDEFINED(length) ? 0 :
TO_INTEGER(length);
Doesn't TO_INTEGER(undefined) yield 0 anyway?
https://codereview.chromium.org/17572009/diff/2001/src/typedarray.js
File src/typedarray.js (right):
https://codereview.chromium.org/17572009/diff/2001/src/typedarray.js#newcode40
src/typedarray.js:40: var offset = IS_UNDEFINED(byteOffset) ? 0 :
TO_INTEGER(byteOffset);
Same here
https://codereview.chromium.org/17572009/diff/2001/src/typedarray.js#newcode160
src/typedarray.js:160: function TypedArraySet(obj, offset) {
and here
https://codereview.chromium.org/17572009/diff/2001/src/typedarray.js#newcode227
src/typedarray.js:227: var offset = IS_UNDEFINED(byteOffset) ? 0 :
TO_INTEGER(byteOffset);
and here
https://codereview.chromium.org/17572009/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.