From efcbe3b21a3504cb2fb8516b3e324aa23c8bbc6a Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 27 Jul 2011 04:34:28 +0200 Subject: [PATCH] typed arrays: add Float64Array --- src/v8_typed_array.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/v8_typed_array.cc b/src/v8_typed_array.cc index ac76d00bb77ae0..3fe11f037e62b6 100644 --- a/src/v8_typed_array.cc +++ b/src/v8_typed_array.cc @@ -385,6 +385,7 @@ class Uint16Array : public TypedArray<2, v8::kExternalUnsignedShortArray> { }; class Int32Array : public TypedArray<4, v8::kExternalIntArray> { }; class Uint32Array : public TypedArray<4, v8::kExternalUnsignedIntArray> { }; class Float32Array : public TypedArray<4, v8::kExternalFloatArray> { }; +class Float64Array : public TypedArray<8, v8::kExternalDoubleArray> { }; template v8::Handle cTypeToValue(T) { @@ -739,6 +740,8 @@ void AttachBindings(v8::Handle obj) { Uint32Array::GetTemplate()->GetFunction()); obj->Set(v8::String::New("Float32Array"), Float32Array::GetTemplate()->GetFunction()); + obj->Set(v8::String::New("Float64Array"), + Float64Array::GetTemplate()->GetFunction()); obj->Set(v8::String::New("DataView"), DataView::GetTemplate()->GetFunction()); } @@ -755,6 +758,8 @@ int SizeOfArrayElementForType(v8::ExternalArrayType type) { case v8::kExternalUnsignedIntArray: case v8::kExternalFloatArray: return 4; + case v8::kExternalDoubleArray: + return 8; default: return 0; }