()
| 99 | } |
| 100 | |
| 101 | const getComplexObjects = async () => { |
| 102 | const state = await new wasmoon.LuaFactory().createEngine() |
| 103 | await state.doString(` |
| 104 | local obj1 = { |
| 105 | hello = 'world', |
| 106 | } |
| 107 | obj1.self = obj1 |
| 108 | local obj2 = { |
| 109 | 5, |
| 110 | hello = 'everybody', |
| 111 | array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, |
| 112 | fn = function() |
| 113 | return 'hello' |
| 114 | end |
| 115 | } |
| 116 | obj2.self = obj2 |
| 117 | obj = { obj1, obj2 } |
| 118 | `) |
| 119 | |
| 120 | console.time('Get complex objects') |
| 121 | state.global.get('obj') |
| 122 | console.timeEnd('Get complex objects') |
| 123 | } |
| 124 | |
| 125 | Promise.resolve() |
| 126 | .then(createFactory) |
nothing calls this directly
no test coverage detected