aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-09-23 11:15:52 +0200
committerLars Knoll <lars.knoll@qt.io>2018-09-27 08:33:52 +0000
commit1804fea8893c355dbd585e373cb9644387410a92 (patch)
treea1e0a43a74f9137b7bc1c9da0332e6c2e3984cde /src/qml/jsruntime/qv4context.cpp
parent7fb4fc2ac7b56d3f60ceb8ae1175bd4596436cc7 (diff)
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 <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r--src/qml/jsruntime/qv4context.cpp10
1 files changed, 5 insertions, 5 deletions
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<Heap::CallContext *>(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<Heap::CallContext *>(ctx);
- uint index = c->internalClass->find(id);
+ uint index = c->internalClass->indexOfValueOrGetter(id);
if (index < UINT_MAX) {
static_cast<Heap::CallContext *>(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<Heap::CallContext *>(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<Heap::CallContext *>(ctx);
- uint index = c->internalClass->find(id);
+ uint index = c->internalClass->indexOfValueOrGetter(id);
if (index < UINT_MAX)
return c->locals[index].asReturnedValue();
Q_FALLTHROUGH();