Ironjs:将对象返回给 JS
使用 Ironjs。我将 ac# 函数注册为 JS 函数(通过 SetGlobal)
它被调用,但我想从该函数返回一个值。该值是 CLR 对象的 IEnumerable。使用 Jint 就可以了:我返回对象并可以 foreach 它等,我如何在 IronJS 中做同样的事情(为什么不使用 Jint,它有错误,例如它不会编译 underscore.js)
编辑:因为我是我不是一个流利的 F# 人,我无法通过阅读代码来回答这个问题。所以我修复了 Jint。不过如果能知道答案还是很高兴
Using Ironjs. I have a c# function registered as a JS function (via SetGlobal)
It gets called , but I want to return a value to from that function. The value is an IEnumerable of CLR objects. Using Jint this just works: I return the object and can foreach it etc, how do I do the same thing in IronJS (Why not use Jint, well it has bugs, for example it wont compile underscore.js)
EDIT: Since I am not a fluent F# person I cannot answer this question myself by reading the code. So instead I fixed Jint. However it would still be nice to know the answer
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们仍在致力于 .NET 互操作。因此,IronJS 中的 foreach 并未设置为枚举 IEnumerables,而是作用于 CommonObject 类型对象。
We are still working on our .NET interop. As such, the foreach in IronJS is not set up to enumerate IEnumerables, but instead works on CommonObject type objects.