From 9306c05dd152511b8b938d7899a7bdf1aeb8d1c2 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 21 Nov 2013 16:41:32 +0100 Subject: Encapsulate the current context and fix it's usage Encapsulate accesses to the current context, and rework the way we push and pop this context from the context stack. Largely a cleanup, but simplifies the code in the long term Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4internalclass.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4internalclass.cpp') diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp index 729ed12884..29ede3d104 100644 --- a/src/qml/jsruntime/qv4internalclass.cpp +++ b/src/qml/jsruntime/qv4internalclass.cpp @@ -297,7 +297,8 @@ void InternalClass::removeMember(Object *object, Identifier *id) } // create a new class and add it to the tree - object->internalClass = engine->emptyClass->changePrototype(prototype); + object->internalClass = engine->emptyClass->changeVTable(vtable); + object->internalClass = object->internalClass->changePrototype(prototype); for (uint i = 0; i < size; ++i) { if (i == propIdx) continue; @@ -330,6 +331,7 @@ InternalClass *InternalClass::sealed() return m_sealed; m_sealed = engine->emptyClass; + m_sealed = m_sealed->changeVTable(vtable); m_sealed = m_sealed->changePrototype(prototype); for (uint i = 0; i < size; ++i) { PropertyAttributes attrs = propertyData.at(i); @@ -347,6 +349,7 @@ InternalClass *InternalClass::frozen() return m_frozen; m_frozen = engine->emptyClass; + m_frozen = m_frozen->changeVTable(vtable); m_frozen = m_frozen->changePrototype(prototype); for (uint i = 0; i < size; ++i) { PropertyAttributes attrs = propertyData.at(i); -- cgit v1.2.3