diff options
Diffstat (limited to 'src/qml/jsruntime/qv4objectproto.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4objectproto.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index bf16073f61..fb47c4a15e 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -412,7 +412,9 @@ ReturnedValue ObjectPrototype::method_toLocaleString(SimpleCallContext *ctx) ReturnedValue ObjectPrototype::method_valueOf(SimpleCallContext *ctx) { - return Value::fromObject(ctx->callData->thisObject.toObject(ctx)).asReturnedValue(); + Scope scope(ctx); + ScopedValue v(scope, ctx->callData->thisObject.toObject(ctx)); + return v.asReturnedValue(); } ReturnedValue ObjectPrototype::method_hasOwnProperty(SimpleCallContext *ctx) @@ -509,7 +511,7 @@ ReturnedValue ObjectPrototype::method_get_proto(SimpleCallContext *ctx) if (!o) ctx->throwTypeError(); - return Value::fromObject(o->prototype()).asReturnedValue(); + return o->prototype()->asReturnedValue(); } ReturnedValue ObjectPrototype::method_set_proto(SimpleCallContext *ctx) |