quickjs-wrapper
quickjs-wrapper copied to clipboard
QuickJS wrapper for Android/JVM
my code, says not a function ```java app.set( "queue", args -> { try { int delay = args.length > 1 ? (int) args[1] : 0; task.run(() -> {try { JSFunction...
能否添加像Rhino JavaScript引擎一样,允许直接使用Java的API,以及可以直接通过set将Java对象注入进JS
quickjs has been updated on 2024/01/13 to [support ES2023](https://github.com/bellard/quickjs/blob/master/Changelog) completely, so it is time to update the wrapper as well. Thanks for your effects.
JSObject中没有一个内部管理的类似map的概念,不知道所有的key值,并且所有的get方法全部是jni native获取,当需要将JSObject转成普通Object(Map)时,无法实现,只能提前预知里面存放的key值数据。 JSArray同样存在获取性能问题,只是多个lenth感知到总长度,每次get时均jni获取。 建议可以参考React Native的中ReadableArray和ReadableMap实现,内部为何一个数据,只需要一次jni接口从底层获取数据。
Thank you so much for this library 🙏 ! I have an easy suggestion for improvement: It would be pragmatic to be able to use QuickJSContext with [try-with-resources](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) (in Java)...

向大佬确认一下。。。 看这个库的方法感觉好像一个App里面只会一个JSRuntime 看了一下另外的两个类似的库 https://github.com/taoweiji/quickjs-android https://github.com/seven332/quickjs-android 都是支持创建多个JSRunTime的(类似JSRuntime runtime = quickJS.createJSRuntime()之类的方法)
https://github.com/openwebf/quickjs 性能优化提升40+ 如果可以建议更换这个
有没有办法直接创建一个 Uint8Array 或 ArrayBuffer 的 JS 值?这个ArrayBuffer可以通过java来写入和读取? 目前只有JSArray ,只能 ```java JSArray array = context.createNewJSArray(); for (int i = 0; i < bytes.length; i++) array.set((int) bytes[i], i); ``` 这样大数据会非常慢。