Brian Wang
Brian Wang
准备关闭此讨论,如果有任何问题,请重新打开。
问题1 : > 我在生成字节码时,需要根据脚本载入所有模块,所以是否可以暴露载入模块的回调? 在LoadModule的实现中, https://github.com/buke/quickjs-go/blob/main/context.go#L383 ,此处cVal 实际返回的是promise 对象,经过C.js_std_await 处理后返回模块对象。你所指的是直接暴露cVal 对象吗? ```go func (ctx *Context) LoadModule(code string, moduleName string) (Value, error) { codePtr := C.CString(code) defer C.free(unsafe.Pointer(codePtr)) filenamePtr := C.CString(moduleName)...
quickjs 已支持ES2023 ,主要原因是https://github.com/bellard/quickjs bugfixed 太慢了
> 当前的这个go库不再更新了吗?建议用ng? 只是想把依赖的quickjs 库转为quickjs-ng,go 库会继续维护和更新 ~
Since https://github.com/bellard/quickjs is active again, I don't think it's necessary to migrate to quickjs-ng. I will close this issue.
not yet . create a class need to expose JS_NewClass https://github.com/buke/quickjs-go/blob/787d3dba3741fa67bd77af8965e614fa7b7772c3/deps/include/quickjs.h#L506 I will add it if I have time , maybe weeks later...
done. please see https://github.com/buke/quickjs-go/pull/459
please try not to using the collection api (such as context.Array() / value.ToArray() ), using context.Eval with js code to instead it . and the collection api will be remove...
I'm going to close this issue. If there are any problems, please feel free to reopen it.