aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context.cpp
diff options
context:
space:
mode:
authorLars Knoll <[email protected]>2013-09-11 13:10:42 +0200
committerThe Qt Project <[email protected]>2013-09-18 13:13:16 +0200
commit826550af450b39f47a3c00ec316acf1e317f12c6 (patch)
tree58fcb1dbb91ea981a6a1cfde61a92b4d4d34eff9 /src/qml/jsruntime/qv4context.cpp
parentd642438b7641ea2ea5416b59327c8f3baf531aa7 (diff)
Adjust return values to use ReturnedValue
Change-Id: I03822d360ad90cc659da66252439472ecb1a52bb Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r--src/qml/jsruntime/qv4context.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 1e42a186a0..a8cdf30b16 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -403,12 +403,12 @@ void ExecutionContext::setProperty(String *name, const Value& value)
engine->globalObject->put(name, value);
}
-Value ExecutionContext::getProperty(String *name)
+ReturnedValue ExecutionContext::getProperty(String *name)
{
name->makeIdentifier();
if (name->isEqualTo(engine->id_this))
- return thisObject;
+ return thisObject.asReturnedValue();
bool hasWith = false;
bool hasCatchScope = false;
@@ -419,7 +419,7 @@ Value ExecutionContext::getProperty(String *name)
bool hasProperty = false;
Value v = w->get(name, &hasProperty);
if (hasProperty) {
- return v;
+ return v.asReturnedValue();
}
continue;
}
@@ -428,7 +428,7 @@ Value ExecutionContext::getProperty(String *name)
hasCatchScope = true;
CatchContext *c = static_cast<CatchContext *>(ctx);
if (c->exceptionVarName->isEqualTo(name))
- return c->exceptionValue;
+ return c->exceptionValue.asReturnedValue();
}
else if (ctx->type >= Type_CallContext) {
@@ -437,20 +437,20 @@ Value ExecutionContext::getProperty(String *name)
if (f->needsActivation || hasWith || hasCatchScope) {
for (unsigned int i = 0; i < f->varCount; ++i)
if (f->varList[i]->isEqualTo(name))
- return c->locals[i];
+ return c->locals[i].asReturnedValue();
for (int i = (int)f->formalParameterCount - 1; i >= 0; --i)
if (f->formalParameterList[i]->isEqualTo(name))
- return c->arguments[i];
+ return c->arguments[i].asReturnedValue();
}
if (c->activation) {
bool hasProperty = false;
Value v = c->activation->get(name, &hasProperty);
if (hasProperty)
- return v;
+ return v.asReturnedValue();
}
if (f->function && f->function->isNamedExpression()
&& name->isEqualTo(f->function->name))
- return Value::fromObject(c->function);
+ return Value::fromObject(c->function).asReturnedValue();
}
else if (ctx->type == Type_GlobalContext) {
@@ -458,19 +458,19 @@ Value ExecutionContext::getProperty(String *name)
bool hasProperty = false;
Value v = g->global->get(name, &hasProperty);
if (hasProperty)
- return v;
+ return v.asReturnedValue();
}
}
throwReferenceError(Value::fromString(name));
- return Value::undefinedValue();
+ return Value::undefinedValue().asReturnedValue();
}
-Value ExecutionContext::getPropertyNoThrow(String *name)
+ReturnedValue ExecutionContext::getPropertyNoThrow(String *name)
{
name->makeIdentifier();
if (name->isEqualTo(engine->id_this))
- return thisObject;
+ return thisObject.asReturnedValue();
bool hasWith = false;
bool hasCatchScope = false;
@@ -481,7 +481,7 @@ Value ExecutionContext::getPropertyNoThrow(String *name)
bool hasProperty = false;
Value v = w->get(name, &hasProperty);
if (hasProperty) {
- return v;
+ return v.asReturnedValue();
}
continue;
}
@@ -490,7 +490,7 @@ Value ExecutionContext::getPropertyNoThrow(String *name)
hasCatchScope = true;
CatchContext *c = static_cast<CatchContext *>(ctx);
if (c->exceptionVarName->isEqualTo(name))
- return c->exceptionValue;
+ return c->exceptionValue.asReturnedValue();
}
else if (ctx->type >= Type_CallContext) {
@@ -499,20 +499,20 @@ Value ExecutionContext::getPropertyNoThrow(String *name)
if (f->needsActivation || hasWith || hasCatchScope) {
for (unsigned int i = 0; i < f->varCount; ++i)
if (f->varList[i]->isEqualTo(name))
- return c->locals[i];
+ return c->locals[i].asReturnedValue();
for (int i = (int)f->formalParameterCount - 1; i >= 0; --i)
if (f->formalParameterList[i]->isEqualTo(name))
- return c->arguments[i];
+ return c->arguments[i].asReturnedValue();
}
if (c->activation) {
bool hasProperty = false;
Value v = c->activation->get(name, &hasProperty);
if (hasProperty)
- return v;
+ return v.asReturnedValue();
}
if (f->function && f->function->isNamedExpression()
&& name->isEqualTo(f->function->name))
- return Value::fromObject(c->function);
+ return Value::fromObject(c->function).asReturnedValue();
}
else if (ctx->type == Type_GlobalContext) {
@@ -520,19 +520,19 @@ Value ExecutionContext::getPropertyNoThrow(String *name)
bool hasProperty = false;
Value v = g->global->get(name, &hasProperty);
if (hasProperty)
- return v;
+ return v.asReturnedValue();
}
}
- return Value::undefinedValue();
+ return Value::undefinedValue().asReturnedValue();
}
-Value ExecutionContext::getPropertyAndBase(String *name, Object **base)
+ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object **base)
{
*base = 0;
name->makeIdentifier();
if (name->isEqualTo(engine->id_this))
- return thisObject;
+ return thisObject.asReturnedValue();
bool hasWith = false;
bool hasCatchScope = false;
@@ -544,7 +544,7 @@ Value ExecutionContext::getPropertyAndBase(String *name, Object **base)
Value v = w->get(name, &hasProperty);
if (hasProperty) {
*base = w;
- return v;
+ return v.asReturnedValue();
}
continue;
}
@@ -553,7 +553,7 @@ Value ExecutionContext::getPropertyAndBase(String *name, Object **base)
hasCatchScope = true;
CatchContext *c = static_cast<CatchContext *>(ctx);
if (c->exceptionVarName->isEqualTo(name))
- return c->exceptionValue;
+ return c->exceptionValue.asReturnedValue();
}
else if (ctx->type >= Type_CallContext) {
@@ -562,10 +562,10 @@ Value ExecutionContext::getPropertyAndBase(String *name, Object **base)
if (f->needsActivation || hasWith || hasCatchScope) {
for (unsigned int i = 0; i < f->varCount; ++i)
if (f->varList[i]->isEqualTo(name))
- return c->locals[i];
+ return c->locals[i].asReturnedValue();
for (int i = (int)f->formalParameterCount - 1; i >= 0; --i)
if (f->formalParameterList[i]->isEqualTo(name))
- return c->arguments[i];
+ return c->arguments[i].asReturnedValue();
}
if (c->activation) {
bool hasProperty = false;
@@ -573,12 +573,12 @@ Value ExecutionContext::getPropertyAndBase(String *name, Object **base)
if (hasProperty) {
if (ctx->type == Type_QmlContext)
*base = c->activation;
- return v;
+ return v.asReturnedValue();
}
}
if (f->function && f->function->isNamedExpression()
&& name->isEqualTo(f->function->name))
- return Value::fromObject(c->function);
+ return Value::fromObject(c->function).asReturnedValue();
}
else if (ctx->type == Type_GlobalContext) {
@@ -586,11 +586,11 @@ Value ExecutionContext::getPropertyAndBase(String *name, Object **base)
bool hasProperty = false;
Value v = g->global->get(name, &hasProperty);
if (hasProperty)
- return v;
+ return v.asReturnedValue();
}
}
throwReferenceError(Value::fromString(name));
- return Value::undefinedValue();
+ return Value::undefinedValue().asReturnedValue();
}