-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: bump package versions to 0.1.19-alpha.1
- Loading branch information
Showing
4 changed files
with
27 additions
and
15 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,25 +1,27 @@ | ||
import { QuickJS } from '@yaksok-ts/quickjs' | ||
import { yaksok } from '@yaksok-ts/core' | ||
import { NumberValue } from './src/node/primitive.ts' | ||
|
||
const quickjs = new QuickJS({ | ||
prompt, | ||
}) | ||
await quickjs.init() | ||
console.time('실행') | ||
|
||
yaksok( | ||
await yaksok( | ||
` | ||
번역(QuickJS), (질문) 물어보기 | ||
번역(Runtime), (숫자)초 기다리기 | ||
*** | ||
return prompt(질문) | ||
wait | ||
*** | ||
입력받은_이름: "이름이 뭐에요?" 물어보기 | ||
입력받은_이름 + "님 안녕하세요!" 보여주기 | ||
"안녕!" 보여주기 | ||
1초 기다리기 | ||
"반가워!" 보여주기 | ||
`, | ||
{ | ||
runFFI(r, code, args) { | ||
const result = quickjs.run(code, args) | ||
return result | ||
async runFFI(_runtime, _code, args) { | ||
await new Promise((ok) => | ||
setTimeout(ok, (args.숫자 as NumberValue).value * 1000), | ||
) | ||
|
||
return new NumberValue(0) | ||
}, | ||
}, | ||
) | ||
console.timeEnd('실행') |