diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-05-12 10:16:51 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-05-19 06:23:13 +0000 |
commit | 931239579d60eff13ef4f7674cc10f27d7bbdf71 (patch) | |
tree | c13894363c4d2dd2632437cb5ec117591ebd64c4 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | c83685bf3ae1c85cf204e0cbf7fc9b5db819a0f5 (diff) |
Move the list of default internal classes into EngineBase
And store them in an enumerated array. This will simplify
upcoming changes.
Change-Id: I82eac03b9f6264843ae625e36e150464fe08be9d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index b2d89220ea..86362fa0cb 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -122,8 +122,8 @@ void FunctionObject::init(String *n, bool createProto) Q_ASSERT(internalClass() && internalClass()->find(s.engine->id_prototype()) == Heap::FunctionObject::Index_Prototype); if (createProto) { - ScopedObject proto(s, scope()->engine->newObject(s.engine->protoClass, s.engine->objectPrototype())); - Q_ASSERT(s.engine->protoClass->find(s.engine->id_constructor()) == Heap::FunctionObject::Index_ProtoConstructor); + ScopedObject proto(s, scope()->engine->newObject(s.engine->internalClasses[EngineBase::Class_ObjectProto], s.engine->objectPrototype())); + Q_ASSERT(s.engine->internalClasses[EngineBase::Class_ObjectProto]->find(s.engine->id_constructor()) == Heap::FunctionObject::Index_ProtoConstructor); *proto->propertyData(Heap::FunctionObject::Index_ProtoConstructor) = this->asReturnedValue(); *propertyData(Heap::FunctionObject::Index_Prototype) = proto.asReturnedValue(); } else { @@ -375,7 +375,7 @@ void ScriptFunction::construct(const Managed *that, Scope &scope, CallData *call Scoped<ScriptFunction> f(scope, static_cast<const ScriptFunction *>(that)); - InternalClass *ic = v4->emptyClass; + InternalClass *ic = v4->internalClasses[EngineBase::Class_Object]; ScopedObject proto(scope, f->protoForConstructor()); ScopedObject obj(scope, v4->newObject(ic, proto)); callData->thisObject = obj.asReturnedValue(); |