diff options
author | Lars Knoll <[email protected]> | 2018-04-03 15:23:07 +0200 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2018-05-02 14:18:36 +0000 |
commit | bab5e5adf578fb37402ff03f4bd5e9ed3ce4c2d2 (patch) | |
tree | 1bbc320c5594faf5d2156385088c12222b9542b8 /src/qml/jsruntime/qv4lookup.cpp | |
parent | a6da23bb5f6004e13d22838c7db1246169874930 (diff) |
Partial Symbol support
Added basic infrastructure to create symbols and convert them
back to strings. In addition, storing and retrieving of symbol
based properties in Objects works.
Change-Id: I185f7aa46e7afa19db5a801102142892e03b7bf1
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4lookup.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index b5a21ca825..e4a7c703fc 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -109,11 +109,12 @@ ReturnedValue Lookup::resolvePrimitiveGetter(ExecutionEngine *engine, const Valu break; case Value::Managed_Type: { // ### Should move this over to the Object path, as strings also have an internalClass - Q_ASSERT(object.isString()); - primitiveLookup.proto = engine->stringPrototype()->d(); + Q_ASSERT(object.isStringOrSymbol()); + primitiveLookup.proto = static_cast<const Managed &>(object).internalClass()->prototype; + Q_ASSERT(primitiveLookup.proto); Scope scope(engine); ScopedString name(scope, engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); - if (name->equals(engine->id_length())) { + if (object.isString() && name->equals(engine->id_length())) { // special case, as the property is on the object itself getter = stringLengthGetter; return stringLengthGetter(this, engine, object); |