From 151284c3cc38ddab3ec1d8af4fc5afa2845674e2 Mon Sep 17 00:00:00 2001 From: Jinny You Date: Thu, 20 Feb 2025 21:01:53 +0800 Subject: [PATCH] lottie/expressions: Fix incorrect evaluation result check condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/loaders/lottie/tvgLottieExpressions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/lottie/tvgLottieExpressions.cpp b/src/loaders/lottie/tvgLottieExpressions.cpp index c83961c1..5d48c3f3 100644 --- a/src/loaders/lottie/tvgLottieExpressions.cpp +++ b/src/loaders/lottie/tvgLottieExpressions.cpp @@ -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();