()
| 57 | } |
| 58 | |
| 59 | const insertComplexObjects = async () => { |
| 60 | const state = await new wasmoon.LuaFactory().createEngine() |
| 61 | const obj1 = { |
| 62 | hello: 'world', |
| 63 | } |
| 64 | obj1.self = obj1 |
| 65 | const obj2 = { |
| 66 | hello: 'everybody', |
| 67 | array: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], |
| 68 | fn: () => { |
| 69 | return 'hello' |
| 70 | }, |
| 71 | } |
| 72 | obj2.self = obj2 |
| 73 | |
| 74 | console.time('Insert complex objects') |
| 75 | state.global.set('obj', { obj1, obj2 }) |
| 76 | console.timeEnd('Insert complex objects') |
| 77 | } |
| 78 | |
| 79 | const insertComplexObjectsWithoutProxy = async () => { |
| 80 | const state = await new wasmoon.LuaFactory().createEngine({ |
nothing calls this directly
no test coverage detected