Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JS exception causing application crash #18067

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading