mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
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:
parent
1416e99f34
commit
151284c3cc
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue