From 13de5c870a0e6cf5b85ba6435c7569225b9693bc Mon Sep 17 00:00:00 2001 From: roko <40763333+rokoblox@users.noreply.github.com> Date: Fri, 10 Nov 2023 02:03:38 +0200 Subject: [PATCH] Adds SharedTable support (#553) Please verify line 623, based on https://create.roblox.com/docs/reference/engine/datatypes/SharedTable#increment Solves #552 --------- Co-authored-by: Chris Chang <51393127+chriscerie@users.noreply.github.com> --- CHANGELOG.md | 1 + selene-lib/default_std/roblox_base.yml | 45 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ddc0eb7..9571630f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Added new [`mixed_table` lint](https://kampfkarren.github.io/selene/lints/mixed_table.html), which will warn against mixed tables. - Added `bit32.byteswap` to Luau standard library - Added `buffer` library to Luau standard library +- Added `SharedTable` to Roblox standard library ### Fixed - `string.pack` and `string.unpack` now have proper function signatures in the Lua 5.3 standard library. diff --git a/selene-lib/default_std/roblox_base.yml b/selene-lib/default_std/roblox_base.yml index 4fa75387..375372dd 100644 --- a/selene-lib/default_std/roblox_base.yml +++ b/selene-lib/default_std/roblox_base.yml @@ -533,6 +533,51 @@ globals: require: args: - type: number + SharedTable.clear: + args: + - type: + display: SharedTable + SharedTable.clone: + args: + - type: + display: SharedTable + - required: false + type: bool + must_use: true + SharedTable.cloneAndFreeze: + args: + - type: + display: SharedTable + - required: false + type: bool + must_use: true + SharedTable.increment: + args: + - type: + display: SharedTable + - type: any + - type: number + SharedTable.isFrozen: + args: + - type: + display: SharedTable + must_use: true + SharedTable.new: + args: + - required: false + type: table + must_use: true + SharedTable.size: + args: + - type: + display: SharedTable + must_use: true + SharedTable.update: + args: + - type: + display: SharedTable + - type: any + - type: function settings: args: [] shared: