Skip to content

Commit

Permalink
Fix JS exception causing application crash (#18067)
Browse files Browse the repository at this point in the history
Co-authored-by: qiuguohua <[email protected]>
  • Loading branch information
qiuguohua and qiuguohua authored Dec 20, 2024
1 parent 40e0769 commit 0e4607f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions native/cocos/bindings/jswrapper/jsvm/CommonHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
SE_LOGE("JSVM error message: %s", messagestr); \
} \
} \
} \
NODE_API_CALL_BASE(env, status, nullptr)
}

// Returns empty if the_call doesn't return JSVM_OK.
#define NODE_API_CALL_RETURN_VOID(env, the_call) \
Expand Down
3 changes: 3 additions & 0 deletions native/cocos/bindings/jswrapper/jsvm/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,19 @@ Object* Object::createTypedArrayWithBuffer(TypedArrayType type, const Object *ob
case TypedArrayType::INT16:
jsvmType = JSVM_INT8_ARRAY;
sizeOfEle = 2;
break;
case TypedArrayType::UINT16:
jsvmType = JSVM_UINT8_ARRAY;
sizeOfEle = 2;
break;
case TypedArrayType::INT32:
jsvmType = JSVM_INT32_ARRAY;
sizeOfEle = 4;
break;
case TypedArrayType::UINT32:
jsvmType = JSVM_UINT32_ARRAY;
sizeOfEle = 4;
break;
case TypedArrayType::FLOAT32:
jsvmType = JSVM_FLOAT32_ARRAY;
sizeOfEle = 4;
Expand Down

0 comments on commit 0e4607f

Please sign in to comment.