Commit Graph
7 Commits
Author SHA1 Message Date
Matouš Jan FialkaandGitHub b363bd7e59 Fix serious truthiness evaluation flaws. (#1644)
In Lua, only the last expression in an argument list preserves multiple
results and all earlier expressions yield exactly one value (their first).

For example:

```
f(a(), b(), c())
```

where

```
a -> (1,2)
b -> (3,4)
c -> (5,6)
```

becomes

```
f(1, 3, 5, 6)
```

which matches Lua behaviour (tested in version 5.4).

Changes:

* Function argument lists keep multiple results only from the last
  argument.

* Fixes failing truthiness tests (`true and ret_one_two()`).

Sidenote: the `truthiness_test.lua` was not called at all because of
my obvious copy/paste typo (the `arithmetical_test.lua` was called twice
instead; now fixed too and both test suites pass ok).
2025-10-20 17:34:45 +02:00
Matouš Jan FialkaandGitHub cb4f392c05 Add huge constant and type() function to the math API (#1632)
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2025-10-16 08:27:56 +02:00
Matouš Jan FialkaandGitHub aa1e61b646 Space Lua: Add load function (#1631)
* Add `load` Lua builtin

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2025-10-16 08:19:37 +02:00
Zef Hemel 3fa9c82add Fixes #1598
Lua: Implements %u in os.date()
2025-10-10 09:11:14 +02:00
Zef Hemel 18e78e5006 Lua: fix key deletion in tables 2025-10-09 09:19:58 +02:00
Zef Hemel d63c7e49a7 Disable js.import tests for now 2025-09-29 15:56:41 +02:00
Zef Hemel f4336bf09f Code restructuring: eliminated the top-level lib/ directory 2025-09-23 17:00:34 +02:00