Skip to content

Commit

Permalink
typed arrays: add Float64Array
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Aug 12, 2011
1 parent 83b211e commit efcbe3b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/v8_typed_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
v8::Handle<v8::Value> cTypeToValue(T) {
Expand Down Expand Up @@ -739,6 +740,8 @@ void AttachBindings(v8::Handle<v8::Object> 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());
}
Expand All @@ -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;
}
Expand Down

0 comments on commit efcbe3b

Please sign in to comment.