* Executes Lua code from a file synchronously. * @param filename - Path to the Lua script file. * @returns - The result returned by the Lua script.
(filename: string)
| 91 | * @returns - The result returned by the Lua script. |
| 92 | */ |
| 93 | public doFileSync(filename: string): any { |
| 94 | this.global.loadFile(filename) |
| 95 | const result = this.global.runSync() |
| 96 | return result[0] |
| 97 | } |
| 98 | |
| 99 | // WARNING: It will not wait for open handles and can potentially cause bugs if JS code tries to reference Lua after executed |
| 100 | private async callByteCode(loader: (thread: Thread) => void): Promise<any> { |
no test coverage detected