mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
typed arrays: add Float64Array
This commit is contained in:
1 parent
83b211ecb2
commit
efcbe3b21a
1 file changed
+5
@@ -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) {
|
||||
@@ -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());
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user