aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4globalobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-24 16:05:14 +0100
committerLars Knoll <lars.knoll@qt.io>2016-11-29 20:00:18 +0000
commit5d35573a62686aa3b0c45fc032b79670d88ebba9 (patch)
tree7e60a301e347ba073d2d310c59083b18eeaa922f /src/qml/jsruntime/qv4globalobject.cpp
parenta36d19546891a808cf71dbb084d6d63870d2b8ec (diff)
Clean up Value::isString()/stringValue() combinations
It's enough to just call stringValue(), as that already does the isString() check. Change-Id: I7be0e643a7975c0704b4c9c43b337deb8db9fce0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4globalobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index feb0d90d26..af92ce1ad8 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -357,12 +357,13 @@ void EvalFunction::evalCall(Scope &scope, CallData *callData, bool directCall) c
ctx = v4->pushGlobalContext();
}
- if (!callData->args[0].isString()) {
+ String *scode = callData->args[0].stringValue();
+ if (!scode) {
scope.result = callData->args[0].asReturnedValue();
return;
}
- const QString code = callData->args[0].stringValue()->toQString();
+ const QString code = scode->toQString();
bool inheritContext = !ctx->d()->strictMode;
Script script(ctx, code, QStringLiteral("eval code"));