diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 15:24:50 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:39 +0200 |
commit | 150731fc68bcf823bec40729285813d902990cb7 (patch) | |
tree | 7af619f4bc8fac030bc162ce6ead2e2a7be86783 /src/qml/jsruntime/qv4objectproto.cpp | |
parent | c79cc3f30d395c94d4f14b978903d7db4ad871dc (diff) |
Remove more direct QV4::Value usage
Remove Value::fromString(String *), and make
Encode safe against encoding raw Managed * pointers.
Change-Id: Ibca4668e1cbeaf85c78169d14386281659d33ef6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
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) |