diff --git a/doric-iOS/Pod/Classes/Engine/JSValue+Doric.mm b/doric-iOS/Pod/Classes/Engine/JSValue+Doric.mm index 43c1a17b..1dcc7404 100644 --- a/doric-iOS/Pod/Classes/Engine/JSValue+Doric.mm +++ b/doric-iOS/Pod/Classes/Engine/JSValue+Doric.mm @@ -123,12 +123,14 @@ static id containerValueToObject(JSGlobalContextRef context, JSContainerConverto } JSObjectRef object = JSValueToObject(context, value, 0); - JSTypedArrayType type = JSValueGetTypedArrayType(context, value, NULL); - if (type == kJSTypedArrayTypeArrayBuffer) { - size_t size = JSObjectGetArrayBufferByteLength(context, object, NULL); - void *ptr = JSObjectGetArrayBufferBytesPtr(context, object, NULL); - id primitive = [[NSData alloc] initWithBytesNoCopy:ptr length:size freeWhenDone:NO]; - return {value, primitive, ContainerNone}; + if (@available(iOS 10.0, *)) { + JSTypedArrayType type = JSValueGetTypedArrayType(context, value, NULL); + if (type == kJSTypedArrayTypeArrayBuffer) { + size_t size = JSObjectGetArrayBufferByteLength(context, object, NULL); + void *ptr = JSObjectGetArrayBufferBytesPtr(context, object, NULL); + id primitive = [[NSData alloc] initWithBytesNoCopy:ptr length:size freeWhenDone:NO]; + return {value, primitive, ContainerNone}; + } } if (JSValueIsArray(context, value)) return {object, [NSMutableArray array], ContainerArray};