diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-06-23 20:08:40 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-07-02 19:29:32 +0000 |
commit | 56602df447c5f16257874f2e97b078dcf76f2467 (patch) | |
tree | 901c76eb6262dad80e6ab94af810c645355cb6d5 /src/qml/jsruntime/qv4qmlcontext.cpp | |
parent | db695c5b1d07275f208446dad178b1131b20bb0a (diff) |
Cleanups in the Identifier API
Rename from/asHeapObject to from/asStringOrSymbol and fix
the signature.
Add a isStringOrSymbol() method and redefine isValid() to also
include array indices.
Change-Id: Ic8272bfbe84d15421e2ebe86ddda7fdaa8db4f3e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qmlcontext.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qmlcontext.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index bbf2ff6352..e04d8bb0e9 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -124,7 +124,7 @@ ReturnedValue QQmlContextWrapper::get(const Managed *m, Identifier id, const Val QObject *scopeObject = resource->getScopeObject(); - ScopedString name(scope, id.asHeapObject()); + ScopedString name(scope, id.asStringOrSymbol()); if (context->imports && name->startsWithUpper()) { // Search for attached properties, enums and imported scripts QQmlTypeNameCache::Result r = context->imports->query(name, QQmlImport::AllowRecursion); @@ -270,7 +270,7 @@ bool QQmlContextWrapper::put(Managed *m, Identifier id, const Value &value, Valu // See QV8ContextWrapper::Getter for resolution order QObject *scopeObject = wrapper->getScopeObject(); - ScopedString name(scope, id.asHeapObject()); + ScopedString name(scope, id.asStringOrSymbol()); while (context) { const QV4::IdentifierHash &properties = context->propertyNames(); |