The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / test / simple / test-typed-arrays.js @ 6f043940

History | View | Annotate | Download (6.8 KB)

# Date Author Comment
ed3d553d 02/11/2013 11:38 AM Ben Noordhuis

typed arrays: make call-as-function work for ctors

Turn call-as-function calls into constructor calls. Makes the following
snippet work:

var buf = ArrayBuffer(32);  // no 'new' but does the right thing
5a9d30bb 02/10/2013 03:31 PM Ben Noordhuis

typed arrays: copy Buffer in typed array constructor

Convert the Buffer to an ArrayBuffer. The typed_array.buffer property
should be an ArrayBuffer to avoid confusion: a Buffer doesn't have a
byteLength property and more importantly, its slice() method works...

fe103357 02/10/2013 09:22 AM Ben Noordhuis

typed arrays: make DataView throw on non-ArrayBuffer

Make the DataView constructor throw an exception when the first
argument is not an ArrayBuffer. Follows the spec and the browsers.

234551a2 02/10/2013 09:22 AM Ben Noordhuis

buffer: fix Buffer::HasInstance() check

It was returning true for typed arrays. Check that the object was
instantiated with the Buffer constructor.

144e21ed 02/10/2013 09:22 AM Ben Noordhuis

Revert "typed arrays: only share ArrayBuffer backing store"

We're going to fix this differently. The real bug is that
Buffer::HasInstance() returns true for typed arrays.

This reverts commit 01ee551e704776d8547250ac015a5463613afb45.

fd9d8b5e 02/10/2013 09:22 AM Ben Noordhuis

Revert "typed arrays: copy non-ArrayBuffer in DataView ctor"

We're going to follow browser behavior here.

This reverts commit 7b0770bff56122c245f83e8ee9608e1a0082c15e.

7b0770bf 02/06/2013 04:26 PM Ben Noordhuis

typed arrays: copy non-ArrayBuffer in DataView ctor

This is commit 01ee551, except for the DataView type this time.

Make the behavior of DataView consistent with that of typed arrays:
make a copy of the backing store.

01ee551e 02/06/2013 08:21 AM Ben Noordhuis

typed arrays: only share ArrayBuffer backing store

Follow browser behavior, only share the backing store when it's a
ArrayBuffer. That is:

var abuf = new ArrayBuffer(32);
var a = new Int8Array(abuf);
var b = new Int8Array(abuf);
a[0] = 0;
b[0] = 1;...
2dd37389 01/19/2013 06:29 PM Ben Noordhuis

typed arrays: fix DataView endianness regression

Fix an off-by-one error introduced in 9fe3734 that caused a regression
in the default endianness used for writes in DataView::setGeneric().

Fixes #4626.

ed825f48 01/09/2013 06:55 PM Ben Noordhuis

typed arrays: fix 32 bit size/index overflow

Fix an out-of-bound read/write bug due to integer wrapping. Reported by
Dean McNamee.

b6b88137 10/23/2012 11:12 AM Ben Noordhuis

test: add typed arrays regression test

Ensure that uint8 values >= 128 are correctly promoted to int8 <= -1.

973bbecf 03/28/2012 07:36 PM Erik Lundin

typed arrays: prevent unaligned typed array views on top of buffers

67fc1daf 03/28/2012 04:57 PM Mikael Bourges-Sevenier

typed arrays: add Uint8ClampedArray

4b1d4925 03/20/2012 08:59 PM Erik Lundin

test: merge typed arrays tests

Merge simple/test-typed-arrays-typenames into simple/test-typed-arrays.

f2ebf246 03/20/2012 08:59 PM Erik Lundin

test: fix simple/test-typed-arrays

  • It incorrectly uses assert(a, b) instead of assert.equal(a, b), meaning all
    relevant assertions will pass regardless of whether they're supposed to when
    a == true.
  • It makes the assumption that elements in typed arrays for numerical types...
7f4aba91 02/20/2012 07:29 AM Ben Noordhuis

test: include common.js in all tests

0cdf85e2 02/18/2012 06:34 PM isaacs

Lint all the JavaScripts.

5b05429b 01/05/2012 02:56 PM Mikael Bourges-Sevenier

typed arrays: add Buffer -> TypedArray constructor

- create a typed array from a node::Buffer object
- update TypedArray::set() to spec
- add TypedArray::get() method