404 Commits

Author SHA1 Message Date
Alex Orlenko ee2da72685 Revert default chunk name change 2025-05-24 12:40:58 +01:00
Alex Orlenko c3ab89ba66 Fix tests 2025-05-24 10:22:26 +01:00
Alex Orlenko 3d2574a855 Revert "Use c string literal where appropriate"
This reverts commit 46e949c184.
2025-05-24 10:19:19 +01:00
Alex Orlenko fbed171f90 Revert "Support 52-bit integers for Luau"
This reverts commit ef8b8e11ec.
2025-05-24 10:18:16 +01:00
Alex Orlenko a7f58e57ec Update scoped userdata mismatch tests 2025-05-05 00:59:00 +01:00
Alex Orlenko e6871525c4 Check that type passed to scoped userdata self argument is userdata.
If passed type is non-userdata we try to get a pointer (which will be null) that triggers an assertion.
Having a check also allow us to generate right error message.
Fixes #569
2025-05-05 00:58:46 +01:00
Alex Orlenko d0ea428e23 Add encode_empty_tables_as_array serialize option.
This will change the behaviour of encoding empty Lua tables into array instead of map.
2025-05-05 00:52:22 +01:00
Alex Orlenko cf687a6ac6 Make Lua::weak() method and WeakLua struct public.
This can be useful to prevent circular dependencies between Rust and Lua
or check that Lua instance is still alive.
2025-05-05 00:50:12 +01:00
Alex Orlenko 90ef25a6ee Prepare for custom (Luau) userdata destructors.
We need to add logic later to prevent calling any Lua functions when UserData destructor is running.
2025-05-05 00:49:17 +01:00
Alex Orlenko 4444ac4ea3 Add AnyUserData::type_id method 2025-05-05 00:47:09 +01:00
Alex Orlenko 375028e13f Add Chunk::name(), Chunk::environment() and Chunk::mode() functions.
They can be used to retrieve existing chunk params.
2025-05-05 00:46:20 +01:00
Alex Orlenko 46e949c184 Use c string literal where appropriate 2025-05-05 00:44:05 +01:00
Alex Orlenko 0393406b9f Refactor userdata-wrappers feature.
Support borrowing underlying data in `UserDataRef` and `UserDataRefMut`.
2025-05-04 18:45:42 +01:00
Alex Orlenko 8e244a25ea Update test case 2025-05-04 12:48:47 +01:00
Alex Orlenko ef8b8e11ec Support 52-bit integers for Luau
Simply to float conversion (it actually never fails or goes out of range)
2025-05-04 12:48:34 +01:00
Alex Orlenko 69d3ddec29 Remove (internal) borrow counter and use instead "locked" flag and strong reference counter 2025-05-04 12:46:35 +01:00
Alex Orlenko 19536db976 Add bstr/serde dependency if serialize feature flag is enabled 2025-05-04 12:30:52 +01:00
Alex Orlenko fc69551f87 Fix tests 2025-05-04 12:29:57 +01:00
Alex Orlenko a68b0b6905 Do not allow recursive warnings (Lua 5.4) 2025-05-04 12:29:51 +01:00
Alex Orlenko 1ec1cc9922 Fix tests 2025-05-04 12:28:40 +01:00
Joel Natividad fd68b033f0 Fix typos (#522)
* fix various typos in the codebase

* fix typos in CHANGELOG.md
2025-05-04 12:28:24 +01:00
Alex Orlenko 863d8092d6 Imporove BorrowedStr/BorrowedBytes ergonomic.
Implement `FromLua` and `IntoLua` for these types to allow working with them directly.
2025-05-04 12:27:24 +01:00
Alex Orlenko 24b6ff3c20 Improve From/Into Lua char conversion 2025-05-04 12:18:28 +01:00
tk bc36261f5c impl FromLua/IntoLua for char (#516) 2025-05-04 12:18:22 +01:00
Alex Orlenko bcb9a4d220 Enable Thread::reset() for all Lua versions 2025-05-04 12:07:55 +01:00
Alex Orlenko cd4091f64d Allow exhaustive match on Value.
It was not possible because `ValueRef` variant in `Value::Other` was private.
Closes #502 and #503
2024-12-10 23:37:19 +00:00
Alex Orlenko cacd3dc70f Add Table::set_safeenv method (Luau) 2024-12-04 10:40:49 +00:00
Alex Orlenko 1c6b6ad801 Fix tests 2024-12-01 12:54:35 +00:00
Alex Orlenko 5fd96c7908 Don't run GC finalizers on ref thread.
If this happen then we don't have full access to the ref thread stack.
Fixes #491
2024-11-30 01:00:31 +00:00
Alex Orlenko 55a5d7ef10 Protect Lua(u) during chunk loading if memory limit is enforced
Relates to #488
2024-11-27 00:34:21 +00:00
Alex Orlenko ee7ced6334 Add Chunk::wrap method 2024-11-22 14:40:52 +00:00
Alex Orlenko 7ce6b97da9 Add String::wrap method to wrap arbitrary AsRef<[u8]> 2024-11-22 11:48:20 +00:00
Alex Orlenko 4891a6ac10 Fix utf-8 test when bstr v1.11 switchted to LowerHex 2024-11-17 18:01:05 +00:00
Alex Orlenko 8c889cc353 Add String::display method 2024-11-09 14:24:43 +00:00
Alex Orlenko 92a8203e1c Fix formatting 2024-11-09 13:58:06 +00:00
Alex Orlenko b34b90eca3 Fix wrong formatting table with string keys that are numbers 2024-11-09 13:51:55 +00:00
Alex Orlenko a3cd25db7a Support Luau 0.650 native vector library 2024-11-09 12:44:00 +00:00
vhyrro 0fda512938 feat(table): improve pretty-printing for simple tables and lists (#478) 2024-11-09 12:08:49 +00:00
Alex Orlenko c7094d470f Add Scope::create_any_userdata to create Lua objects from any non-static Rust types. 2024-11-07 19:44:18 +00:00
Alex Orlenko a7d0691e10 Add AnyUserData::destroy method 2024-11-07 16:12:20 +00:00
Alex Orlenko 1f32754f05 Relax UserDataBorrowRef restrictions to allow recursive calls 2024-11-03 12:18:00 +00:00
Alex Orlenko c2eab173c5 Add userdata-wrappers feature
This feature allow to opt into `impl UserData` for `Rc<T>`/`Arc<T>`/`Rc<RefCell<T>>`/`Arc<Mutex<T>>` where `T: UserData`
Close #470
2024-11-03 11:48:47 +00:00
Alex Orlenko bb311349ec Switch between shared and exclusive lock for UserDataRef depending if T: Sync or not. 2024-11-02 10:38:25 +00:00
Alex Orlenko 5b8681dcf2 Add Scope::add_destructor to attach custom destructors 2024-10-31 14:35:21 +00:00
Alex Orlenko 4e9a17707b Fix tests 2024-10-31 09:23:03 +00:00
Alex Orlenko a8d5f23818 Add Lua::try_app_data_ref and Lua::try_app_data_mut 2024-10-30 15:22:55 +00:00
Alex Orlenko 5ec4e0338a Add From<Vec> and Into<Vec> support to MultiValue and Variadic types 2024-10-30 13:03:08 +00:00
Alex Orlenko 446d63a77e More tests 2024-10-23 15:50:58 +01:00
Alex Orlenko c702077028 More Lua values conversion tests 2024-10-19 15:08:51 +01:00
Alex Orlenko e122f90837 More Either tests 2024-10-19 11:20:25 +01:00