haxe - 使用重构将 Javascript 转换为 Haxe
问题描述
我想将一个 javascript 类转换为 Haxe。(这是 Nakama 后端JS 客户端,nakama-js.umd.js)为了做到这一点,我尝试使用重构工具。这是安装重构后的haxelib工具,我执行了以下命令:
haxelib run refactor js_to_haxe nakama-js.umd.js
但我收到以下错误:
Called from ? line 1
Called from Main.hx line 72
Called from hant/Process.hx line 196
Called from hant/Process.hx line 99
Called from a C function
Called from hant/Process.hx line 174
Called from hant/Process.hx line 173
Called from a C function
Called from C:\MyProg\_tools\motion-twin\haxe\std/neko/Lib.hx line 42
Uncaught exception - load.c(237) : Failed to load library : hant.ndll
Stack trace:
Called from a C function
Called from hant/Process.hx line 10
Called from a C function
Called from hant/Process.hx line 10
Called from hant/Process.hx line 174
Called from a C function
Called from hant/Process.hx line 99
Called from hant/Process.hx line 196
Called from Main.hx line 72
Called from ? line 1
我也尝试安装hant lib。没有改变。
解决方案
$ haxelib run refactor convertFile input.js Output.hx js_to_haxe.rules
这似乎在 haxe 4 中执行(文档中描述的调用适用于 3.x)。
不过,输出似乎并没有真正在 Haxe 中转换。
推荐阅读
- php - 使用 PHP 向使用 Gmail API 发送的电子邮件添加密件抄送
- javascript - 如何在vue中按条件包装html代码而不重复代码?
- android - 最佳实践 Android 包名和 IOS bundleID
- python-3.x - 将处理后的 CSV 文件导入 Pandas 数据框
- python - 如何考虑 Word2Vec 和其他预处理的词对/短语
- swift - 等到另一个进程完成
- vba - 设置变量 VBA 时出现运行时错误 91
- vba - Excel VBA 代码不会打开名为“CON.txt”的文件
- apache-kafka - Confluent Kafka Connect HDFS Sink 连接器延迟
- c# - 使用 GSM-7 和 UCS-2 的 SMS 拆分字符串