LuaMiraiForAndroid icon indicating copy to clipboard operation
LuaMiraiForAndroid copied to clipboard

某些情况下无法调用中文函数

Open HelloMitsuha opened this issue 3 years ago • 4 comments

Describe the bug 无法调用已定义的(中文名)函数?

To Reproduce Steps to reproduce the behavior: ①在脚本任意位置编写(function xxx() end , xxx={["xx"]=function() end}(这个有时候不行) 或 xxx=function() end 形式) ②调用 ③在绝大多数情况下都会出错:attempt to index ? (a nil value)

我已将错误信息在必应搜索,但未能找到原因

Expected behavior 只能构造,无法调用(大多数情况,使用table构造的可以调用,在某些情况(未知)也会失效)

Screenshots IMG20220625214413 IMG20220625214236 IMG20220625214604

Desktop (please complete the following information):

  • OS: null
  • Browser null
  • Version null

Smartphone (please complete the following information):

  • Device: Android
  • OS: Android 9
  • Browser via
  • Version 1.0-alpha5

Additional context 建议还是修一下吧,我这边写脚本需要,为了方便我使用中文,如果修不了那也罢了,谢谢作者

HelloMitsuha avatar Jun 25 '22 14:06 HelloMitsuha

我记得luaj好像不能使用中文function名字,试过英文函数(不在事件内调用),可以用

table调用可行,但是唯独调用那个就不行(我之前试过)

HelloMitsuha avatar Jun 25 '22 14:06 HelloMitsuha

我之前在luaj基础上添加过中文支持,理论上是支持中文的,后面我再测试一下。

only52607 avatar Jun 25 '22 14:06 only52607

我之前在luaj基础上添加过中文支持,理论上是支持中文的,后面我再测试一下。

太谢谢了 我刚刚还测试了一下(table.方法()),两个都是中文,可惜一个成功一个失败,不知道为什么

HelloMitsuha avatar Jun 25 '22 14:06 HelloMitsuha

测试结果如下 IMG1 IMG2

日志

HelloMitsuha avatar Jun 25 '22 14:06 HelloMitsuha