MCPcopy Create free account
hub / github.com/ceifa/wasmoon / getComplexObjects

Function getComplexObjects

bench/steps.js:101–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101const 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
125Promise.resolve()
126 .then(createFactory)

Callers

nothing calls this directly

Calls 3

createEngineMethod · 0.80
doStringMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected