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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user