| 898 | } |
| 899 | |
| 900 | JSTypedArray V8JavaScriptContext::valueToTypedArray(const JSValue& value, JSExceptionTracker& exceptionTracker) { |
| 901 | v8::HandleScope handleScope(_isolate); |
| 902 | |
| 903 | v8::Local<v8::Value> val = fromValdiJSValue(_isolate, value, exceptionTracker); |
| 904 | if (!val->IsTypedArray()) { |
| 905 | exceptionTracker.onError("Value is not TypedArray"); |
| 906 | return JSTypedArray(); |
| 907 | } |
| 908 | v8::Local<v8::TypedArray> arr = v8::Local<v8::TypedArray>::Cast(val); |
| 909 | const auto type = getTypedArrayType(val); |
| 910 | void* data = arr->Buffer()->Data(); |
| 911 | const size_t length = arr->ByteLength(); |
| 912 | return JSTypedArray(type, data, length, toRetainedJSValueRef(IndirectV8Persistent::make(_isolate, val))); |
| 913 | } |
| 914 | |
| 915 | Ref<JSFunction> V8JavaScriptContext::valueToFunction(const JSValue& value, JSExceptionTracker& exceptionTracker) { |
| 916 | v8::HandleScope handleScope(_isolate); |
no test coverage detected