aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4object.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-07-31 12:54:43 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-08-01 13:17:58 +0000
commit1ec824ed2f6b18705ecc4d9565f97ade5319da52 (patch)
tree4af0aa046dda862763ab1c3e61305a6cc23de613 /src/qml/jsruntime/qv4object.cpp
parent5171765d0508cc92f6b37cbb703666d59bc9ec1f (diff)
Fix a cornercase for instanceof
It's possible to define a getter function for the prototype property of Function objects. Ensure this doesn't mess up things by not taking shortcuts. Change-Id: Id981f3080f5c5c0714a1b7b6de27b4af04e794c8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r--src/qml/jsruntime/qv4object.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index 718bfbe5ec..701c22331d 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -742,8 +742,10 @@ ReturnedValue Object::virtualInstanceOf(const Object *typeObject, const Value &v
if (!lhs)
return Encode(false);
+ Scope scope(f->internalClass->engine);
// 15.3.5.3, 2
- const Object *o = f->protoProperty();
+ ScopedFunctionObject ff(scope, f);
+ ScopedObject o(scope, ff->protoProperty());
if (!o) // 15.3.5.3, 3
return engine->throwTypeError();