diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-22 15:04:42 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-22 15:32:19 +0200 |
commit | 07782f48f4318a7261f1b0ddcd686b19ec812e36 (patch) | |
tree | 3fa2aa3a1170ad7ebaf5b1641cdce19a941ca480 /src/qml/jsruntime/qv4engine.cpp | |
parent | 50fcdfd705c2ad9560641986bf4152b017ee8bb6 (diff) | |
parent | f15a90e5d10465e66698209a5d88f1e63ae336fa (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/qml/qml/qqmlbinding.cpp
src/qml/jsruntime/qv4arraybuffer.cpp
src/qml/jsruntime/qv4functionobject.cpp
Change-Id: Ic752e9dfd69b282093651c9234c110a49762f06d
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 9b9a2349a9..8859f73bd7 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -308,6 +308,10 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) functionPrototype = memoryManager->alloc<FunctionPrototype>(functionProtoClass, objectPrototype.as<Object>()); functionClass = emptyClass->addMember(id_prototype, Attr_NotEnumerable|Attr_NotConfigurable, &index); Q_ASSERT(index == Heap::FunctionObject::Index_Prototype); + simpleScriptFunctionClass = functionClass->addMember(id_name, Attr_ReadOnly, &index); + Q_ASSERT(index == Heap::SimpleScriptFunction::Index_Name); + simpleScriptFunctionClass = simpleScriptFunctionClass->addMember(id_length, Attr_ReadOnly, &index); + Q_ASSERT(index == Heap::SimpleScriptFunction::Index_Length); protoClass = emptyClass->addMember(id_constructor, Attr_NotEnumerable, &index); Q_ASSERT(index == Heap::FunctionObject::Index_ProtoConstructor); @@ -585,10 +589,7 @@ Heap::ArrayObject *ExecutionEngine::newArrayObject(InternalClass *ic, Object *pr Heap::ArrayBuffer *ExecutionEngine::newArrayBuffer(const QByteArray &array) { Scope scope(this); - Scoped<ArrayBuffer> object(scope, memoryManager->alloc<ArrayBuffer>(this, array.size())); - if (!hasException) { - memcpy(object->d()->data->data(), array.data(), array.size()); - } + Scoped<ArrayBuffer> object(scope, memoryManager->alloc<ArrayBuffer>(this, array)); return object->d(); } @@ -1741,9 +1742,8 @@ bool ExecutionEngine::metaTypeFromJS(const QV4::Value &value, int type, void *da { QV4::Scoped<QV4::QQmlValueTypeWrapper> vtw(scope, value); - if (vtw && vtw->d()->metaType == type) { - vtw->toGadget(data); - return true; + if (vtw && vtw->typeId() == type) { + return vtw->toGadget(data); } } |