Skip to content

Commit 339ab64

Browse files
committedNov 29, 2024·
fix(playground): 実行終了時の値を出力するように
Fix #3
1 parent 4e28a8c commit 339ab64

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎.vitepress/pages/Playground.vue

+7
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ function initAiScriptEnv() {
195195
text: value.type === 'num' ? value.value.toString() : value.type === 'str' ? `"${value.value}"` : JSON.stringify(utils.valToJs(value), null, 2) ?? '',
196196
});
197197
},
198+
log: (type, params) => {
199+
if (type === 'end' && params.val != null && 'type' in params.val) {
200+
logs.value.push({
201+
text: utils.valToString(params.val, true),
202+
});
203+
}
204+
},
198205
});
199206
}
200207

0 commit comments

Comments
 (0)
Please sign in to comment.