JavaScriptCore外部阵列 [英] JavaScriptCore External Arrays

查看:86
本文介绍了JavaScriptCore外部阵列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用iOS的JavaScriptCore,并且一直在尝试找出一种方法来按照v8中的"​​SetIndexedPropertiesToExternalArrayData"的方式进行操作,在该方法中我将有一个javascript对象,并将其设置为数组数据指向另一个对象的数组.例如,如果我有一个空的javascript对象,而另一个javascript对象看起来像:

I've been messing around with JavaScriptCore for iOS and I've been trying to figure out a way to do something along the lines of "SetIndexedPropertiesToExternalArrayData" from v8, where I would have a javascript object, and set it's array data to point to another object's array. For example, if I were to have an empty javascript object, and another javascript object that looked like:

{ '0': 0, '1': 1, '2': 2 };

如果我要使空的javascript对象指向数组对象,则每当我调用[曾经为空的] array []运算符时,它将与其他javascript的数组值相同.

and if I were to make the empty javascript object point to the array object, whenever I call the [what used to be empty] array [] operator it would be the same as the other javascript's array values.

我一直在尝试不同的事物,但是我还没有找到一种方法.我的最终目标是在iOS中创建类型数组,但如果我没记错的话,iOSCore JavaScriptCore中不存在外部数组和类型数组?

I've been trying to play around with different things and I have yet to find a way to do so. My end goal of this is to create typed arrays in iOS, but if I'm not mistaken, external arrays and typed arrays are non existent in the iOS build of JavaScriptCore?

非常感谢.

推荐答案

iOS 7附带的JavaScriptCore构建确实具有类型数组,但是不幸的是,公共API不会公开它们,因此您无法从中获取它们的数据.本国的.但是,这是iOS的JavaScriptCore专用分叉,它在类型数组API周围公开了公共包装.

The build of JavaScriptCore that comes with iOS 7 does have typed arrays, but unfortunately the public API doesn't expose them so you can't touch their data from native. However, there's this iOS-specific fork of JavaScriptCore that exposes a public wrapper around the typed arrays API.

这篇关于JavaScriptCore外部阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆