Skip to content

Commit

Permalink
style: move targetValue higher
Browse files Browse the repository at this point in the history
  • Loading branch information
robik committed May 23, 2024
1 parent 79d87eb commit 6911c97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/VM/JSLib/TypedArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,7 @@ typedArrayPrototypeWith(void *, Runtime &runtime, NativeArgs args) {
if (res == ExecutionStatus::EXCEPTION) {
return ExecutionStatus::EXCEPTION;
}
auto targetValue = runtime.makeHandle(res.getValue());

HermesValue actualIndexValue =
HermesValue::encodeTrustedNumberValue(actualIndex);
Expand All @@ -1843,7 +1844,6 @@ typedArrayPrototypeWith(void *, Runtime &runtime, NativeArgs args) {
}
}

auto targetValue = runtime.makeHandle(res.getValue());
if (LLVM_UNLIKELY(
A->setOwnIndexed(A, runtime, actualIndex, targetValue) ==
ExecutionStatus::EXCEPTION)) {
Expand Down

0 comments on commit 6911c97

Please sign in to comment.