diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-03-09 11:40:44 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-30 12:55:23 +0200 |
commit | 833336fa963b3cd9f1996d7d255098f523dfa580 (patch) | |
tree | 98c74d813bbd4068392ccb46346fe9e68adad687 /src/qml/qml/qqmlexpression.cpp | |
parent | 5534768481f478e93b8b3bd0f7fb0327da5af221 (diff) |
Loosen shared binding tests
Previously we blocked all function calls, but only because we were trying
to prevent "eval" calls from appearing in shared bindings. Instead this
test allows function calls as long as the identifier "eval" doesn't
appear.
This also exposed a crash with v8 bindings that is also fixed.
Change-Id: I22eefd290c7b82d9c01b2cd2907a46e560ae4db9
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlexpression.cpp')
-rw-r--r-- | src/qml/qml/qqmlexpression.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp index 6e20047cf0..940b3c8354 100644 --- a/src/qml/qml/qqmlexpression.cpp +++ b/src/qml/qml/qqmlexpression.cpp @@ -60,7 +60,7 @@ static QQmlJavaScriptExpression::VTable QQmlExpressionPrivate_jsvtable = { QQmlExpressionPrivate::QQmlExpressionPrivate() : QQmlJavaScriptExpression(&QQmlExpressionPrivate_jsvtable), expressionFunctionValid(true), expressionFunctionRewritten(false), - extractExpressionFromFunction(false), line(-1), dataRef(0) + line(-1) { } @@ -68,8 +68,6 @@ QQmlExpressionPrivate::~QQmlExpressionPrivate() { qPersistentDispose(v8qmlscope); qPersistentDispose(v8function); - if (dataRef) dataRef->release(); - dataRef = 0; } void QQmlExpressionPrivate::init(QQmlContextData *ctxt, const QString &expr, QObject *me) @@ -321,13 +319,7 @@ QQmlContext *QQmlExpression::context() const QString QQmlExpression::expression() const { Q_D(const QQmlExpression); - if (d->extractExpressionFromFunction && context()->engine()) { - QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(context()->engine()); - v8::HandleScope handle_scope; - v8::Context::Scope scope(v8engine->context()); - - return v8engine->toString(v8::Handle<v8::Value>(d->v8function)); - } else if (!d->expressionUtf8.isEmpty()) { + if (!d->expressionUtf8.isEmpty()) { return QString::fromUtf8(d->expressionUtf8); } else { return d->expression; |