-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
217 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { Lua } from '../dist/index.js'; | ||
import { JsType, Lua } from '../dist/index.js'; | ||
|
||
// This file was created as a sandbox to test and debug on vscode | ||
const lua = await Lua.create(); | ||
|
||
lua.ctx.null = JsType.decorate(null).tostring(() => 'null'); | ||
|
||
lua.global.loadString(` | ||
local i = 0 | ||
while true do i = i + 1 end | ||
local args = { ... } | ||
assert(args[1] == null, string.format("expected first argument to be null, got %s", tostring(args[1]))) | ||
return null, args[1], tostring(null) | ||
`); | ||
|
||
await lua.global.run(0, { timeout: 5 }).catch((e) => console.log(e)); | ||
lua.global.pushValue(null); | ||
const res = await lua.global.run(1); | ||
expect(res).to.deep.equal([null, null, 'null']); |
Oops, something went wrong.