From 1804fea8893c355dbd585e373cb9644387410a92 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 23 Sep 2018 11:15:52 +0200 Subject: Refactor InternalClass::find() Specialize find() into several methods for different purposes. Prepares for further cleanups and being able to split up getter and setter for accessor properties. Change-Id: Id4ec5509ac1a1361e2170bbfc2347b89b520c782 Reviewed-by: Erik Verbruggen --- src/qml/jsruntime/qv4context.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qml/jsruntime/qv4context.cpp') diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 6e3e7f9b4f..38e233965f 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -220,7 +220,7 @@ bool ExecutionContext::deleteProperty(String *name) case Heap::ExecutionContext::Type_BlockContext: case Heap::ExecutionContext::Type_CallContext: { Heap::CallContext *c = static_cast(ctx); - uint index = c->internalClass->find(id); + uint index = c->internalClass->indexOfValueOrGetter(id); if (index < UINT_MAX) // ### throw in strict mode? return false; @@ -286,7 +286,7 @@ ExecutionContext::Error ExecutionContext::setProperty(String *name, const Value case Heap::ExecutionContext::Type_BlockContext: case Heap::ExecutionContext::Type_CallContext: { Heap::CallContext *c = static_cast(ctx); - uint index = c->internalClass->find(id); + uint index = c->internalClass->indexOfValueOrGetter(id); if (index < UINT_MAX) { static_cast(c)->locals.set(engine, index, value); return NoError; @@ -295,7 +295,7 @@ ExecutionContext::Error ExecutionContext::setProperty(String *name, const Value Q_FALLTHROUGH(); case Heap::ExecutionContext::Type_GlobalContext: if (ctx->activation) { - uint member = ctx->activation->internalClass->find(id); + uint member = ctx->activation->internalClass->indexOfValueOrGetter(id); if (member < UINT_MAX) { Scope scope(engine); ScopedObject a(scope, ctx->activation); @@ -332,7 +332,7 @@ ReturnedValue ExecutionContext::getProperty(String *name) case Heap::ExecutionContext::Type_CallContext: { Heap::CallContext *c = static_cast(ctx); - uint index = c->internalClass->find(id); + uint index = c->internalClass->indexOfValueOrGetter(id); if (index < UINT_MAX) return c->locals[index].asReturnedValue(); Q_FALLTHROUGH(); @@ -382,7 +382,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base) case Heap::ExecutionContext::Type_CallContext: { Heap::CallContext *c = static_cast(ctx); - uint index = c->internalClass->find(id); + uint index = c->internalClass->indexOfValueOrGetter(id); if (index < UINT_MAX) return c->locals[index].asReturnedValue(); Q_FALLTHROUGH(); -- cgit v1.2.3