Biting the bullet: exposing the JS window object to Lua

- Added a convenience function for creating HTML widgets, streamlining widget creation.
- Enhanced the key retrieval logic in the pairs function to ensure it captures prototype keys correctly.
- Exposed the global window object in the jsApi for better access to DOM functions.
This commit is contained in:
Zef Hemel
2025-03-31 15:51:02 +02:00
parent db62692d5a
commit bf8646d89d
5 changed files with 19 additions and 17 deletions
+5 -1
View File
@@ -55,7 +55,11 @@ const pairsFunction = new LuaBuiltinFunction(
} else if (t.keys) {
keys = t.keys();
} else {
keys = Object.keys(t); // For plain JavaScript objects
// For plain JavaScript objects case, note: this will also includes keys from the prototype
keys = [];
for (const key in t) {
keys.push(key);
}
}
let i = 0;