mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Use correct index in DataViewObject::setViewValue
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
98f54274d1
commit
2cc649c97e
1 changed files with 3 additions and 2 deletions
|
|
@ -90,8 +90,8 @@ public:
|
|||
ErrorObject::throwBuiltinError(state, ErrorCode::RangeError, state.context()->staticStrings().DataView.string(), false, String::emptyString(), ErrorObject::Messages::GlobalObject_InvalidArrayBufferOffset);
|
||||
}
|
||||
|
||||
// Perform coercion first before any buffer state checks
|
||||
auto numericValue = val.toNumeric(state);
|
||||
UNUSED_VARIABLE(numericValue);
|
||||
|
||||
bool isLittleEndian = _isLittleEndian.toBoolean();
|
||||
throwTypeErrorIfDetached(state);
|
||||
|
|
@ -105,7 +105,8 @@ public:
|
|||
}
|
||||
|
||||
size_t bufferIndex = numberIndex + viewOffset;
|
||||
buffer()->setValueInBuffer(state, bufferIndex, type, val, isLittleEndian);
|
||||
// Pass the already-coerced numeric value to prevent re-coercion in setValueInBuffer
|
||||
buffer()->setValueInBuffer(state, bufferIndex, type, numericValue.first, isLittleEndian);
|
||||
}
|
||||
};
|
||||
} // namespace Escargot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue