19 Commits

Author SHA1 Message Date
Alex Crichton 6e353d6c9f Build/test wasm32-wasip2 in CI (#649)
This is a follow-up from mlua-rs/lua-src-rs#13 which verifies/tests that
mlua/lua all work when compiled for a WASI target. While this doesn't
have formal documentation yet it also codifies in CI configuration how
to build for WASI and get tests passing (notably C compiler
configuration and some misc Rust flags).

This moves some `dev-dependencies` that don't compile for
`wasm32-wasip2` to a different section of the manifest. This
additionally annotates panicking tests with `#[cfg(not(panic =
"abort"))]` to skip those tests on WASI.

This does not test either the `send` or `async` feature at this time.
Testing `send` requires threads which WASI does not yet support, and
testing `async` requires more support in Tokio which is not currently
there yet.
2025-10-04 09:52:23 +01:00
Alex Orlenko a653d08768 Simplify Compiler::add_library_constant (combine lib and member) 2025-07-09 00:11:46 +01:00
Alex Orlenko 2b6b0144a1 Merge Compiler::set_vector_lib into set_vector_ctor 2025-07-08 23:55:45 +01:00
Alex Orlenko b1f73ec29d Update Luau Compiler methods to better control extra options:
- Add `add_mutable_global`
- Add `add_userdata_type`
- Replace `set_library_constants` with `add_library_constant`
- Add `add_disabled_builtin`
2025-07-08 22:22:44 +01:00
Alex Orlenko b0140cdb9e Add Chunk::name(), Chunk::environment() and Chunk::mode() functions.
They can be used to retrieve existing chunk params.
2025-03-22 09:31:24 +00:00
Alex Orlenko 18497f1528 Add library constants support for Luau compiler.
Add ability to specify compile-time constants for known library members.
2025-02-11 00:16:22 +00:00
Alex Orlenko ee7ced6334 Add Chunk::wrap method 2024-11-22 14:40:52 +00:00
Alex Orlenko 735aa22be9 Fix typo in chunk tests 2024-10-16 23:57:07 +01:00
Alex Orlenko 5479546b27 Update chunk tests 2024-10-16 21:54:22 +01:00
Alex Orlenko 91fe02da45 Add LuaNativeFn/LuaNativeFnMut/LuaNativeAsyncFn traits for using in Function::wrap 2024-09-24 14:35:03 +01:00
Alex Orlenko 3641c98959 Prepare for Rust 2024 edition (see rust-lang/rust#123748)
Replace `IntoLua(Multi)` generic with positional arg (impl trait) where possible
This allow to shorten syntax from `a.get::<_, T>` to `a.get::<T>`
2024-07-31 23:42:43 +01:00
Alex Orlenko b4892c228c Add rustfmt.toml 2024-07-31 13:42:37 +01:00
Alex Orlenko 9ed0d90746 Run tests for wasm32-unknown-emscripten 2024-01-06 12:12:56 +00:00
ByteDream 0b9a85e183 Add lua emscripten support (#338) 2023-12-14 14:54:57 +00:00
Alex Orlenko 3a096ae64a Fix warning when compiling chunk tests 2023-07-28 21:45:13 +01:00
Alex Orlenko 8b71f94141 Fix AsChunk trait to support capturing wrapped Lua types (AnyUserData::wrap() and Function::wrap()).
This is a breaking change, the `'lua` lifetime used to in environment moved to the trait declaration.
2023-07-27 13:56:48 +01:00
Alex Orlenko 6a647f58be Add Error::downcast_ref() method 2023-03-19 00:22:51 +00:00
Alex Orlenko 56abc4a700 Refactor AsChunk trait 2022-12-19 21:12:36 +00:00
Alex Orlenko d3975bdf30 Refactor AsChunk trait.
Remove blanket implementation for T: AsRef<[u8]>
Implement for `std::path::Path`
2022-04-14 20:48:00 +01:00