lua – 最新版本中的Loadstring函数替换

前端之家收集整理的这篇文章主要介绍了lua – 最新版本中的Loadstring函数替换前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我从lua 5.1更新到5.3.2,我的一个脚本无法工作导致尝试调用nil值(全局’loadstring’)那么,他们是否用新函数替换它?

在那里你可以找到功能https://www.lua.org/pil/8.html
在那里你可以测试它(不起作用)http://www.lua.org/cgi-bin/demo

解决方法

从Lua 5.2开始,loadstring已被 load取代.

Lua 5.2 reference manual开始:

Function loadstring is deprecated. Use load instead; it now accepts string arguments and are exactly equivalent to loadstring.

原文链接:https://www.f2er.com/lua/274461.html

猜你在找的Lua相关文章