Repository navigation
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
emmylua_ls 0.25.1 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What's Changed * fix(docs): wrap and indent overflowing signatures by @Nerixyz in EmmyLuaLs/emmylua-analyzer-rust#1209 * fix compound assignment alignment formatting by @hfn92 in EmmyLuaLs/emmylua-analyzer-rust#1210 * chore(doc_cli): Format JS and CSS with Prettier by @Nerixyz in EmmyLuaLs/emmylua-analyzer-rust#1212 * Fix runtime versions for math.randomseed() by @ligurio in EmmyLuaLs/emmylua-analyzer-rust#1214 * fix(flow): handle lesser array length guards by @lewis6991 in EmmyLuaLs/emmylua-analyzer-rust#1216 * perf: avoid rebuilding large inferred unions by @lewis6991 in EmmyLuaLs/emmylua-analyzer-rust#1217 **Full Changelog**: https://github.com/EmmyLuaLs/emmylua-analyzer-rust/compare/0.25.0...0.25.1</pre> <p>View the full release notes at <a href="https://github.com/EmmyLuaLs/emmylua-analyzer-rust/releases/tag/0.25.1">https://github.com/EmmyLuaLs/emmylua-analyzer-rust/releases/tag/0.25.1</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!16552
Fixes #1213