Skip to content

Commit 0e4607f

Browse files
qiuguohuaqiuguohua
andauthored
Fix JS exception causing application crash (#18067)
Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
1 parent 40e0769 commit 0e4607f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

native/cocos/bindings/jswrapper/jsvm/CommonHeader.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
SE_LOGE("JSVM error message: %s", messagestr); \
6868
} \
6969
} \
70-
} \
71-
NODE_API_CALL_BASE(env, status, nullptr)
70+
}
7271

7372
// Returns empty if the_call doesn't return JSVM_OK.
7473
#define NODE_API_CALL_RETURN_VOID(env, the_call) \

native/cocos/bindings/jswrapper/jsvm/Object.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,19 @@ Object* Object::createTypedArrayWithBuffer(TypedArrayType type, const Object *ob
383383
case TypedArrayType::INT16:
384384
jsvmType = JSVM_INT8_ARRAY;
385385
sizeOfEle = 2;
386+
break;
386387
case TypedArrayType::UINT16:
387388
jsvmType = JSVM_UINT8_ARRAY;
388389
sizeOfEle = 2;
389390
break;
390391
case TypedArrayType::INT32:
391392
jsvmType = JSVM_INT32_ARRAY;
392393
sizeOfEle = 4;
394+
break;
393395
case TypedArrayType::UINT32:
394396
jsvmType = JSVM_UINT32_ARRAY;
395397
sizeOfEle = 4;
398+
break;
396399
case TypedArrayType::FLOAT32:
397400
jsvmType = JSVM_FLOAT32_ARRAY;
398401
sizeOfEle = 4;

0 commit comments

Comments
 (0)