diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-04 09:31:10 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-12 13:59:02 +0000 |
commit | 3932536b59df7b2fa010be6dd9f2501f6e306c8b (patch) | |
tree | de989972a3f123f108c193c4b3e6e9e33528bdb2 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 30850d1ebc28bfe68b329229b537a7d6a7791b29 (diff) |
Better encapsulation for EngineBase::internalClass
Turn it into a method instead of accessing the array directly
to simplify refactoring.
Change-Id: I197b56c8f58cfdfd294f429e6b15268c755f9837
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 27c97858c6..7cee808812 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -144,8 +144,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, s.engine->newObject(s.engine->internalClasses[EngineBase::Class_ObjectProto])); - Q_ASSERT(s.engine->internalClasses[EngineBase::Class_ObjectProto]->find(s.engine->id_constructor()) == Heap::FunctionObject::Index_ProtoConstructor); + ScopedObject proto(s, s.engine->newObject(s.engine->internalClasses(EngineBase::Class_ObjectProto))); + Q_ASSERT(s.engine->internalClasses(EngineBase::Class_ObjectProto)->find(s.engine->id_constructor()) == Heap::FunctionObject::Index_ProtoConstructor); proto->setProperty(Heap::FunctionObject::Index_ProtoConstructor, d()); setProperty(Heap::FunctionObject::Index_Prototype, proto); } else { @@ -422,7 +422,7 @@ InternalClass *ScriptFunction::classForConstructor() const if (ic && ic->prototype == o->d()) return ic; - ic = engine()->internalClasses[EngineBase::Class_Object]; + ic = engine()->internalClasses(EngineBase::Class_Object); if (o) ic = ic->changePrototype(o->d()); d()->cachedClassForConstructor = ic; |