Showing the changes to libraries/script-engine/src/TypedArrayPrototype.cpp (1 of 1 file). Show all
Unified · Split
| @@ -30,11 +30,11 @@ void TypedArrayPrototype::set(QScriptValue array, qint32 offset) { · 29 unmodified lines | ||
| 30 | 30 | engine()->evaluate("throw \"ArgumentError: negative offset\""); |
| 31 | 31 | } |
| 32 | 32 | quint32 length = array.property("length").toInt32(); |
| 33 | − if (offset + length > thisObject().data().property(typedArray->_lengthName).toInt32()) { | |
| 33 | + if (offset + (qint32)length > thisObject().data().property(typedArray->_lengthName).toInt32()) { | |
| 34 | 34 | engine()->evaluate("throw \"ArgumentError: array does not fit\""); |
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | − for (int i = 0; i < length; ++i) { | |
| 37 | + for (quint32 i = 0; i < length; ++i) { | |
| 38 | 38 | thisObject().setProperty(QString::number(offset + i), array.property(QString::number(i))); |
| 39 | 39 | } |
| 40 | 40 | } else { |