Showing the changes to libraries/script-engine/src/DataViewClass.cpp (1 of 2 files). Show all
Unified · Split
| @@ -74,12 +74,9 @@ QScriptValue DataViewClass::construct(QScriptContext *context, QScriptEngine *en · 73 unmodified lines | |||
| 74 | engine->evaluate("throw \"RangeError: byteLength out of range\""); | 74 | engine->evaluate("throw \"RangeError: byteLength out of range\""); |
| 75 | return QScriptValue(); | 75 | return QScriptValue(); |
| 76 | } | 76 | } |
| 77 | 77 | quint32 byteOffset = (byteOffsetArg.isNumber()) ? byteOffsetArg.toInt32() : 0; | |
| 78 | QScriptValue newObject = cls->newInstance(bufferArg, | 78 | quint32 byteLength = (byteLengthArg.isNumber()) ? byteLengthArg.toInt32() : arrayBuffer->size() - byteOffset; |
| 79 | (byteOffsetArg.isNumber()) ? byteOffsetArg.toInt32() | 79 | QScriptValue newObject = cls->newInstance(bufferArg, byteOffset, byteLength); |
| 80 | : 0, | ||
| 81 | (byteLengthArg.isNumber()) ? byteLengthArg.toInt32() | ||
| 82 | : arrayBuffer->size()); | ||
| 83 | 80 | ||
| 84 | if (context->isCalledAsConstructor()) { | 81 | if (context->isCalledAsConstructor()) { |
| 85 | context->setThisObject(newObject); | 82 | context->setThisObject(newObject); |