diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-07-31 12:54:43 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-01 13:17:58 +0000 |
commit | 1ec824ed2f6b18705ecc4d9565f97ade5319da52 (patch) | |
tree | 4af0aa046dda862763ab1c3e61305a6cc23de613 /src/qml/jsruntime/qv4functionobject_p.h | |
parent | 5171765d0508cc92f6b37cbb703666d59bc9ec1f (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/qv4functionobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index ba1146af37..a9ffa90b90 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -91,8 +91,6 @@ DECLARE_HEAP_OBJECT(FunctionObject, Object) { unsigned int formalParameterCount() { return function ? function->nFormals : 0; } unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; } - - const QV4::Object *protoProperty() const { return propertyData(Index_Prototype)->as<QV4::Object>(); } }; struct FunctionCtor : FunctionObject { @@ -190,6 +188,9 @@ struct Q_QML_EXPORT FunctionObject: Object { bool isBinding() const; bool isBoundFunction() const; + ReturnedValue protoProperty() const { return get(engine()->id_prototype()); } + + QQmlSourceLocation sourceLocation() const; }; |