Showing the changes to libraries/script-engine/src/ArrayBufferPrototype.cpp (1 of 6 files). Show all
Unified · Split
| @@ -11,19 +11,19 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include <QScriptEngine> |
| 13 | 13 | |
| 14 | +#include "ArrayBufferClass.h" | |
| 15 | + | |
| 14 | 16 | #include "ArrayBufferPrototype.h" |
| 15 | 17 | |
| 18 | +Q_DECLARE_METATYPE(QByteArray*) | |
| 19 | + | |
| 16 | 20 | ArrayBufferPrototype::ArrayBufferPrototype(QObject* parent) : QObject(parent) { |
| 17 | 21 | } |
| 18 | 22 | |
| 19 | 23 | QByteArray ArrayBufferPrototype::slice(long begin, long end) const { |
| 20 | − if (end == -1) { | |
| 21 | − return thisArrayBuffer().mid(begin); | |
| 22 | − } else { | |
| 23 | − return thisArrayBuffer().mid(begin, end); | |
| 24 | − } | |
| 24 | + return thisArrayBuffer()->mid(begin, end); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | −QByteArray ArrayBufferPrototype::thisArrayBuffer() const { | |
| 28 | − return qscriptvalue_cast<QByteArray>(thisObject().data()); | |
| 27 | +QByteArray* ArrayBufferPrototype::thisArrayBuffer() const { | |
| 28 | + return qscriptvalue_cast<QByteArray*>(thisObject().data()); | |
| 29 | 29 | } |