Fix runtime versions for math.randomseed() - #1214
Conversation
There was a problem hiding this comment.
Looking at this code change, I can provide the following review:
Summary
The change adds "JIT" to the version annotation for the math.randomseed function documentation in the Lua standard library definitions.
Analysis
What the change does
- Adds
JITto the@versionannotation formath.randomseed - This indicates that the function is available in LuaJIT in addition to Lua 5.1, 5.2, and 5.3
Potential Issues
-
Incomplete documentation update: The change only updates the
@versionannotation but doesn't update the function description to mention any LuaJIT-specific behavior. LuaJIT'smath.randomseedhas some differences from standard Lua implementations (particularly regarding how it handles the seed value and the random number generator algorithm). -
Consistency concern: While
math.randomseedexists in LuaJIT, it's worth verifying that all other functions in this file that are available in LuaJIT have also been properly annotated. If this is part of a larger effort to add LuaJIT support, there might be other functions that need similar updates. -
Version specificity: The annotation is somewhat ambiguous - LuaJIT has different versions (2.0, 2.1) and the annotation doesn't specify which LuaJIT versions support this function. However,
math.randomseedhas been available since early LuaJIT versions, so this is a minor concern.
Recommendations
-
Consider updating the description: Add a note about LuaJIT-specific behavior if there are any differences in how
math.randomseedworks in LuaJIT compared to standard Lua. -
Check for completeness: If this is part of a broader effort to add LuaJIT support, ensure all other LuaJIT-compatible functions in the standard library files are also properly annotated.
-
Consider more specific versioning: If LuaJIT has version-specific differences, you might want to use more specific annotations like "JIT 2.0+" or "JIT 2.1+" to be more precise.
Verdict
The change is technically correct and minimal - math.randomseed is indeed available in LuaJIT. The modification is safe and improves documentation accuracy. No blocking issues found, but consider the recommendations above for completeness.
|
|
||
| --- @version 5.1, 5.2, 5.3 | ||
| --- @version 5.1, 5.2, 5.3, JIT | ||
| --- |
There was a problem hiding this comment.
Since all Lua versions support it, you might as well just delete it directly ---@version
4c76e9a to
ed6a064
Compare
Fixes #1213