Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Updates to TypedArrays to match spec. Edit #4547

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants

deanm commented Jan 9, 2013

This is a re-request of joyent#4442

These again are a few effective reverts of previous changes by Mikael Bourges-Sevenier to the TypedArrays code. I believe it was caused by a misreading of the spec, where get() and set() methods are defined as getters/setters ([] and []= operators). By removing these and updating a few exception strings the TypedArray implementation now fully passes the following related WebKit tests:

array-buffer-crash.html
array-buffer-view-crash-when-reassigned.html
array-buffer-view-crash.html
array-constructor.html
array-get-and-set-method-removal.html
array-get-out-of-bounds.html
array-override-set.html
array-set-invalid-arguments.html
array-set-out-of-bounds.html
array-set-with-offset.html
array-setters.html
array-unit-tests.html
dfg-float32array.js
dfg-int16array.js
dfg-int32array-overflow-values.js
dfg-int32array.js
dfg-int8array.js
dfg-uint16array.js
dfg-uint32array-overflow-values.js
dfg-uint32array.js
dfg-uint8array.js
dfg-uint8clampedarray.js

deanm added some commits Dec 19, 2012

@deanm deanm Remove TypedArrays get().
This seems to have been added as a result of misreading the spec, there is no
get() method, only a getter (which the spec names get()), but this is actually
the [] operator.  There are many webkit tests that explicitly test for the
fact that the get() method is abscent.  Remove it to conform to the spec.
18ea925
@deanm deanm Remove TypedArrays set(index, val) and match WebKit exception strings.
It seems that like get(), set(index, val) was added as a misreading of the spec.
There are only two set() methods defined in the spec:
    void set(TypedArray array, optional unsigned long offset)
    void set(type[] array, optional unsigned long offset)
The set(index, val) is handled by the []= operator.
Additionally updated a few exception error strings to match WebKit.
254907b
@deanm deanm TypedArrays: Update a few c casts to C++ static_casts. e703b0c
@deanm deanm TypedArrays: Update some exception messages to match WebKit. a203899

Can one of the admins verify this patch?

We now use the typed arrays directly from V8, thanks!

@tjfontaine tjfontaine closed this Feb 18, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment