mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 12:08:16 +08:00
improve fscript
This commit is contained in:
parent
84da6b5380
commit
b7442a473a
@ -1,4 +1,6 @@
|
||||
# 最新动态
|
||||
2022/01/02
|
||||
* 修复fscript中while语句对return的处理。
|
||||
|
||||
2022/01/01
|
||||
* 优化fscript函数调用。
|
||||
|
@ -386,6 +386,8 @@ static ret_t fscript_exec_while(fscript_t* fscript, fscript_func_call_t* iter, v
|
||||
done = TRUE;
|
||||
fscript->breaked = FALSE;
|
||||
break;
|
||||
} else if (fscript->returned) {
|
||||
done = TRUE;
|
||||
} else if (fscript->continued) {
|
||||
fscript->continued = FALSE;
|
||||
break;
|
||||
|
@ -1544,3 +1544,13 @@ TEST(FScript, on_error) {
|
||||
value_reset(&v);
|
||||
TK_OBJECT_UNREF(obj);
|
||||
}
|
||||
|
||||
TEST(FScript, while_return) {
|
||||
value_t v;
|
||||
tk_object_t* obj = object_default_create();
|
||||
|
||||
fscript_eval(obj, "while(true){return}", &v);
|
||||
value_reset(&v);
|
||||
|
||||
TK_OBJECT_UNREF(obj);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user