aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-03-24 13:11:35 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-03-24 20:21:31 +0000
commitc32468189941c61be6266da3913de5c1c469bd95 (patch)
treea52bb6034639b604c821d72eeb476cee1513deca
parent3cb86b26e532398d078f9dcb47c4910bb3c777f0 (diff)
Fix prototype property when set to non-objects
Commit 180decaf11ea6fb1147825a78a95c455400f7c7e regressed ch15/15.3/15.3.5/S15.3.5.3_A2_T6 in the sense that when a non-object was set for the prototype property, the protoProperty() helper function would perform an unsafe cast to Object * and return a non-null pointer, which however instanceof() does not expect. Change-Id: I134fd41f6b2d3349ebe7d9e91c6b6e5788f599b6 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index 45d7485f1b..f4ac37219c 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -81,7 +81,7 @@ struct Q_QML_PRIVATE_EXPORT FunctionObject : Object {
unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; }
bool needsActivation() const { return function ? function->needsActivation() : false; }
- const QV4::Object *protoProperty() const { return propertyData(Index_Prototype)->cast<QV4::Object>(); }
+ const QV4::Object *protoProperty() const { return propertyData(Index_Prototype)->as<QV4::Object>(); }
Pointer<ExecutionContext> scope;
Function *function;