mirror of
https://github.com/openharmony/ark_js_runtime.git
synced 2026-07-19 19:43:48 -04:00
@@ -311,7 +311,7 @@ JSTaggedValue TypedArrayHelper::CreateFromArrayBuffer(EcmaRuntimeCallInfo *argv,
|
||||
// a. Let newByteLength be newLength × elementSize.
|
||||
// b. If offset + newByteLength > bufferByteLength, throw a RangeError exception.
|
||||
newByteLength = newLength * elementSize;
|
||||
if (offset + newByteLength > bufferByteLength) {
|
||||
if (static_cast<uint32_t>(offset + newByteLength) > bufferByteLength) {
|
||||
THROW_RANGE_ERROR_AND_RETURN(thread, "The newByteLength is out of range.", JSTaggedValue::Exception());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ void JSHClass::RegisterOnProtoChain(const JSThread *thread, const JSHandle<JSHCl
|
||||
|
||||
while (true) {
|
||||
// Find the prototype chain as far as the hclass has not been registered.
|
||||
if (userDetails->GetRegisterIndex() != ProtoChangeDetails::UNREGISTERED) {
|
||||
if (userDetails->GetRegisterIndex() != static_cast<uint32_t>(ProtoChangeDetails::UNREGISTERED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ bool JSHClass::UnregisterOnProtoChain(const JSThread *thread, const JSHandle<JSH
|
||||
}
|
||||
JSHandle<ProtoChangeDetails> currentDetails = GetProtoChangeDetails(thread, jshclass);
|
||||
uint32_t index = currentDetails->GetRegisterIndex();
|
||||
if (index == ProtoChangeDetails::UNREGISTERED) {
|
||||
if (index == static_cast<uint32_t>(ProtoChangeDetails::UNREGISTERED)) {
|
||||
return false;
|
||||
}
|
||||
JSTaggedValue proto = jshclass->GetPrototype();
|
||||
|
||||
Reference in New Issue
Block a user