We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
同样是中间有 null 的两个数组,为什么第一个数组出现了数据丢失?
await native.unpack([1, null, 2]) // 错误 // 实例输出 [undefined, 1] // 预期输出 [undefined, 1, null, 2] await native.table.unpack([1, 2, null, 3]) // 正确 // 实例输出 [undefined, 1, 2, null, 3] // 预期输出 [undefined, 1, 2, null, 3]
在原生代码中 使用 thread 可以重现此问题:
使用 thread
import console; import thread.command console.open() var listener = thread.command.instance(); listener.publish = function(...){ var data = {...} console.writeText(web.json.stringify(data), '---\r\n') } thread.command.publish({null, 1, 3}) // 输出 [{}] -- 数据丢失 thread.command.publish({1, null, 3}) // 输出 [[1]] -- 数据丢失 thread.command.publish({1, 2, null, 3}) // 输出 [[1,2,null,3]] -- 数据没有丢失 import win win.loopMessage()
在原生代码中 不使用 thread 没有重现此问题:
不使用 thread
import console fn = function(...){ var data = {...} return table.unpack(data); } console.dumpJson(fn({1, null, 3})) // 输出 [1, null, 3] import web.json console.writeText(web.json.stringify({1, null, 3}), '---\r\n') // 输出 [1, null, 3] import win win.loopMessage()
The text was updated successfully, but these errors were encountered:
aardio 文档:
数组含 null 实例输出:
代码:
import console var array = { "值:1", null, "值:2", "值:4" } console.dump(array) import win win.loopMessage()
输出:
{ [1]="值:1"; [3]="值:2"; [4]="值:4" }table: 029F4860
Sorry, something went wrong.
Deleted.
feat: Improve json parameter compatibility #8
a4e9ea2
No branches or pull requests
同样是中间有 null 的两个数组,为什么第一个数组出现了数据丢失?
起因
排查
在原生代码中
使用 thread
可以重现此问题:在原生代码中
不使用 thread
没有重现此问题:环境
The text was updated successfully, but these errors were encountered: