MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getTypedArrayType

Function getTypedArrayType

valdi/src/valdi/v8/V8JavaScriptContext.cpp:45–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43namespace Valdi::V8 {
44
45TypedArrayType getTypedArrayType(const v8::Local<v8::Value>& val) {
46 if (val->IsUint8Array()) {
47 return TypedArrayType::Uint8Array;
48 } else if (val->IsUint16Array()) {
49 return TypedArrayType::Uint16Array;
50 } else if (val->IsUint32Array()) {
51 return TypedArrayType::Uint32Array;
52 } else if (val->IsInt8Array()) {
53 return TypedArrayType::Int8Array;
54 } else if (val->IsInt16Array()) {
55 return TypedArrayType::Int16Array;
56 } else if (val->IsInt32Array()) {
57 return TypedArrayType::Int32Array;
58 } else if (val->IsFloat32Array()) {
59 return TypedArrayType::Float32Array;
60 } else if (val->IsFloat64Array()) {
61 return TypedArrayType::Float64Array;
62 } else {
63 SC_ABORT("Unrecognized TypedArray type");
64 return Uint8Array;
65 }
66}
67
68enum class IsolateDataSlot { ContextSlot = 0, Count };
69

Callers 1

valueToTypedArrayMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected