aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-03-18 09:12:42 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-19 08:14:50 +0100
commitcfd3eda076e81d56f985c830663ae93317b6ef8b (patch)
treeb46fd616bfbe5170fd65198a561f19d7a5f37c0e /src/qml/jsruntime
parent4606bd668375770b8f9d84b1739c8a17cfc928d7 (diff)
Fixes to for...in statement
Properly convert the argument to an object if it's not null or undefined as mandated by the standard. Add a similar test case for the with statement. Change-Id: Idd8e245e8dae4803eb0e2010e3d43bb912670444 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 431c2d6979..bbebc2184e 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -632,7 +632,7 @@ ReturnedValue Runtime::foreachIterator(ExecutionContext *ctx, const ValueRef in)
Scope scope(ctx);
Scoped<Object> o(scope, (Object *)0);
if (!in->isNullOrUndefined())
- o = in;
+ o = in->toObject(ctx);
Scoped<Object> it(scope, ctx->engine->newForEachIteratorObject(ctx, o));
return it.asReturnedValue();
}