summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2024-03-20 19:20:05 +0000
committerAlex Orlenko <zxteam@protonmail.com>2024-03-20 19:20:05 +0000
commit3d431034310711818d96cdd8c64ad2c437710f84 (patch)
tree177efff53197f1b70f86434fd92d96d7b4bd94ee
parent5a22437d5fe2c21276e17879e5e23db271bcffdc (diff)
downloadmlua-3d431034310711818d96cdd8c64ad2c437710f84.zip
Make `__idiv` metamethod available for luau
Closes #383
-rw-r--r--src/userdata.rs6
-rw-r--r--src/util/mod.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/userdata.rs b/src/userdata.rs
index d9496a3..1cd6b82 100644
--- a/src/userdata.rs
+++ b/src/userdata.rs
@@ -54,8 +54,8 @@ pub enum MetaMethod {
/// The unary minus (`-`) operator.
Unm,
/// The floor division (//) operator.
- /// Requires `feature = "lua54/lua53"`
- #[cfg(any(feature = "lua54", feature = "lua53"))]
+ /// Requires `feature = "lua54/lua53/luau"`
+ #[cfg(any(feature = "lua54", feature = "lua53", feature = "luau"))]
IDiv,
/// The bitwise AND (&) operator.
/// Requires `feature = "lua54/lua53"`
@@ -180,7 +180,7 @@ impl MetaMethod {
MetaMethod::Pow => "__pow",
MetaMethod::Unm => "__unm",
- #[cfg(any(feature = "lua54", feature = "lua53"))]
+ #[cfg(any(feature = "lua54", feature = "lua53", feature = "luau"))]
MetaMethod::IDiv => "__idiv",
#[cfg(any(feature = "lua54", feature = "lua53"))]
MetaMethod::BAnd => "__band",
diff --git a/src/util/mod.rs b/src/util/mod.rs
index 699bfc1..595407e 100644
--- a/src/util/mod.rs
+++ b/src/util/mod.rs
@@ -928,7 +928,7 @@ pub unsafe fn init_error_registry(state: *mut ffi::lua_State) -> Result<()> {
"__mod",
"__pow",
"__unm",
- #[cfg(any(feature = "lua54", feature = "lua53"))]
+ #[cfg(any(feature = "lua54", feature = "lua53", feature = "luau"))]
"__idiv",
#[cfg(any(feature = "lua54", feature = "lua53"))]
"__band",