Permalink
Browse files

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.
  • Loading branch information...
1 parent c207d40 commit 18ea925cbd5c80a903a2c0c372642db4abb5e9da @deanm committed Dec 19, 2012
Showing with 4 additions and 15 deletions.
  1. +0 −11 src/v8_typed_array.cc
  2. +4 −4 test/simple/test-typed-arrays.js
View
@@ -217,7 +217,6 @@ class TypedArray {
v8::Local<v8::Signature> default_signature = v8::Signature::New(ft_cache);
static BatchedMethods methods[] = {
- { "get", &TypedArray<TBytes, TEAType>::get },
{ "set", &TypedArray<TBytes, TEAType>::set },
{ "slice", &TypedArray<TBytes, TEAType>::subarray },
{ "subarray", &TypedArray<TBytes, TEAType>::subarray },
@@ -350,16 +349,6 @@ class TypedArray {
return args.This();
}
- static v8::Handle<v8::Value> get(const v8::Arguments& args) {
- if (args.Length() < 1)
- return ThrowError("Wrong number of arguments.");
-
- if (args[0]->IsNumber())
- return args.This()->Get(args[0]->Uint32Value());
-
- return v8::Undefined();
- }
-
static v8::Handle<v8::Value> set(const v8::Arguments& args) {
if (args.Length() < 1)
return ThrowError("Wrong number of arguments.");
@@ -153,13 +153,13 @@ sub[1] = 0x34;
assert.equal(uint8[2], 0x12);
assert.equal(uint8[3], 0x34);
-// test .set(index, value), .set(arr, offset) and .get(index)
+// test .set(index, value), .set(arr, offset)
uint8.set(1, 0x09);
uint8.set([0x0a, 0x0b], 2);
-assert.equal(uint8.get(1), 0x09);
-assert.equal(uint8.get(2), 0x0a);
-assert.equal(uint8.get(3), 0x0b);
+assert.equal(uint8[1], 0x09);
+assert.equal(uint8[2], 0x0a);
+assert.equal(uint8[3], 0x0b);
// test clamped array
var uint8c = new Uint8ClampedArray(buffer);

0 comments on commit 18ea925

Please sign in to comment.