mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:57:34 +00:00
LibJS: Compare types instead of sizes in %TypedArray%.prototype.set
Just checking for a matching size is not enough, since floats and ints have the same size, but are represented completely differently.
This commit is contained in:
parent
c7a8902746
commit
13aee1b780
1 changed files with 1 additions and 1 deletions
|
@ -725,7 +725,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::set)
|
||||||
auto limit = checked_limit.value();
|
auto limit = checked_limit.value();
|
||||||
|
|
||||||
// 24. If srcType is the same as targetType, then
|
// 24. If srcType is the same as targetType, then
|
||||||
if (source_typed_array.element_size() == typed_array->element_size()) {
|
if (source_typed_array.element_name() == typed_array->element_name()) {
|
||||||
// a. NOTE: If srcType and targetType are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data.
|
// a. NOTE: If srcType and targetType are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data.
|
||||||
// b. Repeat, while targetByteIndex < limit,
|
// b. Repeat, while targetByteIndex < limit,
|
||||||
// i. Let value be GetValueFromBuffer(srcBuffer, srcByteIndex, Uint8, true, Unordered).
|
// i. Let value be GetValueFromBuffer(srcBuffer, srcByteIndex, Uint8, true, Unordered).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue