lottie/expressions: Fix incorrect evaluation result check condition

A JavaScript code line may return undefined, but this should not be treated as an error.

For example, consider the following two lines of code:
- `var $bm_rt = 30` (Statement) → result: `undefined`
- `$bm_rt = 30` (Expression) → result: `30`

Both lines execute the same operation, but the JavaScript interpreter (REPL JS) evaluates them differently.

Therefore, an evaluation result of undefined should not be blocked, as it does not indicate a failed code execution.
This commit is contained in:
Jinny You 2025-02-20 21:01:53 +08:00 committed by Hermet Park
parent 1416e99f34
commit 151284c3cc

View file

@ -1355,7 +1355,7 @@ jerry_value_t LottieExpressions::evaluate(float frameNo, LottieExpression* exp)
//evaluate the code
auto eval = jerry_eval((jerry_char_t *) exp->code, strlen(exp->code), JERRY_PARSE_NO_OPTS);
if (jerry_value_is_exception(eval) || jerry_value_is_undefined(eval)) {
if (jerry_value_is_exception(eval)) {
TVGERR("LOTTIE", "Failed to dispatch the expressions!");
exp->disabled = true;
return jerry_undefined();