From 6e05ab2bc4598b86082766e5a51ad3a6c9e637b7 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sat, 4 Jan 2014 22:32:13 +0100 Subject: Add Object::hasOwnProperty() This allows us to remove more getOwnProperty calls. This will be required later on to extend our array handling. Change-Id: I7b7f5887990cd443accf51891644fdfbb849cf35 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4context.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/qml/jsruntime/qv4context.cpp') diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index f5d8106f06..35ed8fe0f3 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -362,16 +362,9 @@ void ExecutionContext::setProperty(const StringRef name, const ValueRef value) } if (activation) { - if (ctx->type == Type_QmlContext) { + if (ctx->type == Type_QmlContext || activation->hasOwnProperty(name)) { activation->put(name, value); return; - } else { - PropertyAttributes attrs; - Property *p = activation->__getOwnProperty__(name, &attrs); - if (p) { - activation->putValue(p, attrs, value); - return; - } } } } -- cgit v1.2.3