diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2018-09-11 11:07:32 +0200 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-17 07:47:09 +0000 |
| commit | 1dac47c1418b44cf4a56b42bfca2b277795fd213 (patch) | |
| tree | 26727943c30628340662a66d7cbe9f52d75c5b58 /src/qml/jsruntime/qv4include.cpp | |
| parent | d89d5cffe79bd060a1b04a2c47a3d728bffbe195 (diff) | |
Cleanups in Value/Primitive
Get rid of Primitive and move the corresponding methods
directly into Value. Mark many methods in Value as
constexpr and turn Value into a POD type again.
Keep Primitive as a pure alias to Value for source
compatibility of other modules that might be using it.
Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4include.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4include.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index e3e16fa070..e456879d9c 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -101,11 +101,11 @@ QV4::ReturnedValue QV4Include::resultValue(QV4::ExecutionEngine *v4, Status stat QV4::ScopedObject o(scope, v4->newObject()); QV4::ScopedString s(scope); QV4::ScopedValue v(scope); - o->put((s = v4->newString(QStringLiteral("OK"))), (v = QV4::Primitive::fromInt32(Ok))); - o->put((s = v4->newString(QStringLiteral("LOADING"))), (v = QV4::Primitive::fromInt32(Loading))); - o->put((s = v4->newString(QStringLiteral("NETWORK_ERROR"))), (v = QV4::Primitive::fromInt32(NetworkError))); - o->put((s = v4->newString(QStringLiteral("EXCEPTION"))), (v = QV4::Primitive::fromInt32(Exception))); - o->put((s = v4->newString(QStringLiteral("status"))), (v = QV4::Primitive::fromInt32(status))); + o->put((s = v4->newString(QStringLiteral("OK"))), (v = QV4::Value::fromInt32(Ok))); + o->put((s = v4->newString(QStringLiteral("LOADING"))), (v = QV4::Value::fromInt32(Loading))); + o->put((s = v4->newString(QStringLiteral("NETWORK_ERROR"))), (v = QV4::Value::fromInt32(NetworkError))); + o->put((s = v4->newString(QStringLiteral("EXCEPTION"))), (v = QV4::Value::fromInt32(Exception))); + o->put((s = v4->newString(QStringLiteral("status"))), (v = QV4::Value::fromInt32(status))); if (!statusText.isEmpty()) o->put((s = v4->newString(QStringLiteral("statusText"))), (v = v4->newString(statusText))); @@ -173,20 +173,20 @@ void QV4Include::finished() script.run(); if (scope.engine->hasException) { QV4::ScopedValue ex(scope, scope.engine->catchException()); - resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Exception))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Value::fromInt32(Exception))); QV4::ScopedString exception(scope, v4->newString(QStringLiteral("exception"))); resultObj->put(exception, ex); } else { - resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(Ok))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Value::fromInt32(Ok))); } } else { - resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(NetworkError))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Value::fromInt32(NetworkError))); } #else QV4::Scope scope(v4); QV4::ScopedObject resultObj(scope, m_resultObject.value()); QV4::ScopedString status(scope, v4->newString(QStringLiteral("status"))); - resultObj->put(status, QV4::ScopedValue(scope, QV4::Primitive::fromInt32(NetworkError))); + resultObj->put(status, QV4::ScopedValue(scope, QV4::Value::fromInt32(NetworkError))); #endif // qml_network QV4::ScopedValue cb(scope, m_callbackFunction.value()); @@ -210,7 +210,7 @@ QV4::ReturnedValue QV4Include::method_include(const QV4::FunctionObject *b, cons if ((!context || !context->isJSContext) && scope.engine->qmlEngine()) RETURN_RESULT(scope.engine->throwError(QString::fromUtf8("Qt.include(): Can only be called from JavaScript files"))); - QV4::ScopedValue callbackFunction(scope, QV4::Primitive::undefinedValue()); + QV4::ScopedValue callbackFunction(scope, QV4::Value::undefinedValue()); if (argc >= 2 && argv[1].as<QV4::FunctionObject>()) callbackFunction = argv[1]; |
