From a0fcf724ef1d8586301a913d2cd744aed33e3605 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 29 May 2018 22:41:34 +0200 Subject: Add the start of a Map from ES7 Like Set, for the time being, this is baseed on top of ArrayObject: two of them, one for keys, one for values. Again, this goes against the spirit of the spec (which requires nonlinear access), but having the API present is at least a start, and the implementation is easily changed. Change-Id: Idcf0ad8d92eb5daac734d52e8e2dd4c8e0dd5109 Reviewed-by: Lars Knoll --- src/qml/jsruntime/jsruntime.pri | 8 +- src/qml/jsruntime/qv4engine.cpp | 15 + src/qml/jsruntime/qv4engine_p.h | 7 + src/qml/jsruntime/qv4managed.cpp | 3 + src/qml/jsruntime/qv4managed_p.h | 1 + src/qml/jsruntime/qv4mapiterator.cpp | 109 ++++++++ src/qml/jsruntime/qv4mapiterator_p.h | 104 +++++++ src/qml/jsruntime/qv4mapobject.cpp | 354 ++++++++++++++++++++++++ src/qml/jsruntime/qv4mapobject_p.h | 117 ++++++++ tests/auto/qml/ecmascripttests/TestExpectations | 135 --------- tests/auto/qml/qjsengine/tst_qjsengine.cpp | 1 + 11 files changed, 717 insertions(+), 137 deletions(-) create mode 100644 src/qml/jsruntime/qv4mapiterator.cpp create mode 100644 src/qml/jsruntime/qv4mapiterator_p.h create mode 100644 src/qml/jsruntime/qv4mapobject.cpp create mode 100644 src/qml/jsruntime/qv4mapobject_p.h diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri index 91b68f6d79..97610a0e40 100644 --- a/src/qml/jsruntime/jsruntime.pri +++ b/src/qml/jsruntime/jsruntime.pri @@ -48,7 +48,9 @@ SOURCES += \ $$PWD/qv4arraybuffer.cpp \ $$PWD/qv4typedarray.cpp \ $$PWD/qv4dataview.cpp \ - $$PWD/qv4vme_moth.cpp + $$PWD/qv4vme_moth.cpp \ + $$PWD/qv4mapobject.cpp \ + $$PWD/qv4mapiterator.cpp qtConfig(qml-debug): SOURCES += $$PWD/qv4profiling.cpp @@ -108,7 +110,9 @@ HEADERS += \ $$PWD/qv4arraybuffer_p.h \ $$PWD/qv4typedarray_p.h \ $$PWD/qv4dataview_p.h \ - $$PWD/qv4vme_moth_p.h + $$PWD/qv4vme_moth_p.h \ + $$PWD/qv4mapobject_p.h \ + $$PWD/qv4mapiterator_p.h qtConfig(qml-sequence-object) { HEADERS += \ diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 1f326d3ead..6e8dfbc09c 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,7 @@ #include #include "qv4symbol_p.h" #include "qv4setobject_p.h" +#include "qv4mapobject_p.h" #include #include #include @@ -423,6 +425,7 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) jsObjects[URIError_Ctor] = memoryManager->allocate(global); jsObjects[IteratorProto] = memoryManager->allocate(); jsObjects[ForInIteratorProto] = memoryManager->allocObject(newInternalClass(ForInIteratorPrototype::staticVTable(), iteratorPrototype())); + jsObjects[MapIteratorProto] = memoryManager->allocObject(newInternalClass(SetIteratorPrototype::staticVTable(), iteratorPrototype())); jsObjects[SetIteratorProto] = memoryManager->allocObject(newInternalClass(SetIteratorPrototype::staticVTable(), iteratorPrototype())); jsObjects[ArrayIteratorProto] = memoryManager->allocObject(newInternalClass(ArrayIteratorPrototype::staticVTable(), iteratorPrototype())); jsObjects[StringIteratorProto] = memoryManager->allocObject(newInternalClass(StringIteratorPrototype::staticVTable(), iteratorPrototype())); @@ -451,6 +454,7 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) static_cast(iteratorPrototype())->init(this); static_cast(forInIteratorPrototype())->init(this); + static_cast(mapIteratorPrototype())->init(this); static_cast(setIteratorPrototype())->init(this); static_cast(arrayIteratorPrototype())->init(this); static_cast(stringIteratorPrototype())->init(this); @@ -461,6 +465,10 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) sequencePrototype()->cast()->init(); #endif + jsObjects[Map_Ctor] = memoryManager->allocate(global); + jsObjects[MapProto] = memoryManager->allocate(); + static_cast(mapPrototype())->init(this, mapCtor()); + jsObjects[Set_Ctor] = memoryManager->allocate(global); jsObjects[SetProto] = memoryManager->allocate(); static_cast(setPrototype())->init(this, setCtor()); @@ -515,6 +523,8 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) globalObject->defineDefaultProperty(QStringLiteral("ArrayBuffer"), *arrayBufferCtor()); globalObject->defineDefaultProperty(QStringLiteral("DataView"), *dataViewCtor()); globalObject->defineDefaultProperty(QStringLiteral("Set"), *setCtor()); + globalObject->defineDefaultProperty(QStringLiteral("Map"), *mapCtor()); + for (int i = 0; i < Heap::TypedArray::NTypes; ++i) globalObject->defineDefaultProperty((str = typedArrayCtors[i].as()->name())->toQString(), typedArrayCtors[i]); ScopedObject o(scope); @@ -824,6 +834,11 @@ Heap::Object *ExecutionEngine::newForInIteratorObject(Object *o) return obj->d(); } +Heap::Object *ExecutionEngine::newMapIteratorObject(Object *o) +{ + return memoryManager->allocate(o->d(), this); +} + Heap::Object *ExecutionEngine::newSetIteratorObject(Object *o) { return memoryManager->allocate(o->d(), this); diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 9e5f3fa162..ecc110a16f 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -187,12 +187,14 @@ public: ArrayBufferProto, DataViewProto, SetProto, + MapProto, IntrinsicTypedArrayProto, ValueTypeProto, SignalHandlerProto, IteratorProto, ForInIteratorProto, SetIteratorProto, + MapIteratorProto, ArrayIteratorProto, StringIteratorProto, @@ -216,6 +218,7 @@ public: ArrayBuffer_Ctor, DataView_Ctor, Set_Ctor, + Map_Ctor, IntrinsicTypedArray_Ctor, GetSymbolSpecies, @@ -251,6 +254,7 @@ public: FunctionObject *arrayBufferCtor() const { return reinterpret_cast(jsObjects + ArrayBuffer_Ctor); } FunctionObject *dataViewCtor() const { return reinterpret_cast(jsObjects + DataView_Ctor); } FunctionObject *setCtor() const { return reinterpret_cast(jsObjects + Set_Ctor); } + FunctionObject *mapCtor() const { return reinterpret_cast(jsObjects + Map_Ctor); } FunctionObject *intrinsicTypedArrayCtor() const { return reinterpret_cast(jsObjects + IntrinsicTypedArray_Ctor); } FunctionObject *typedArrayCtors; @@ -283,6 +287,7 @@ public: Object *arrayBufferPrototype() const { return reinterpret_cast(jsObjects + ArrayBufferProto); } Object *dataViewPrototype() const { return reinterpret_cast(jsObjects + DataViewProto); } Object *setPrototype() const { return reinterpret_cast(jsObjects + SetProto); } + Object *mapPrototype() const { return reinterpret_cast(jsObjects + MapProto); } Object *intrinsicTypedArrayPrototype() const { return reinterpret_cast(jsObjects + IntrinsicTypedArrayProto); } Object *typedArrayPrototype; @@ -291,6 +296,7 @@ public: Object *iteratorPrototype() const { return reinterpret_cast(jsObjects + IteratorProto); } Object *forInIteratorPrototype() const { return reinterpret_cast(jsObjects + ForInIteratorProto); } Object *setIteratorPrototype() const { return reinterpret_cast(jsObjects + SetIteratorProto); } + Object *mapIteratorPrototype() const { return reinterpret_cast(jsObjects + MapIteratorProto); } Object *arrayIteratorPrototype() const { return reinterpret_cast(jsObjects + ArrayIteratorProto); } Object *stringIteratorPrototype() const { return reinterpret_cast(jsObjects + StringIteratorProto); } @@ -517,6 +523,7 @@ public: Heap::Object *newForInIteratorObject(Object *o); Heap::Object *newSetIteratorObject(Object *o); + Heap::Object *newMapIteratorObject(Object *o); Heap::Object *newArrayIteratorObject(Object *o); Heap::QmlContext *qmlContext() const; diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp index 304aded44d..58f5b0051f 100644 --- a/src/qml/jsruntime/qv4managed.cpp +++ b/src/qml/jsruntime/qv4managed.cpp @@ -125,6 +125,9 @@ QString Managed::className() const case Type_ExecutionContext: s = "__ExecutionContext"; break; + case Type_MapIteratorObject: + s = "Map Iterator"; + break; case Type_SetIteratorObject: s = "Set Iterator"; break; diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 949b4cdcb4..f16bf3dc58 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -200,6 +200,7 @@ public: Type_ExecutionContext, Type_InternalClass, Type_SetIteratorObject, + Type_MapIteratorObject, Type_ArrayIteratorObject, Type_StringIteratorObject, Type_ForInIterator, diff --git a/src/qml/jsruntime/qv4mapiterator.cpp b/src/qml/jsruntime/qv4mapiterator.cpp new file mode 100644 index 0000000000..74b0dda791 --- /dev/null +++ b/src/qml/jsruntime/qv4mapiterator.cpp @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Crimson AS +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +using namespace QV4; + +DEFINE_OBJECT_VTABLE(MapIteratorObject); + +void MapIteratorPrototype::init(ExecutionEngine *e) +{ + defineDefaultProperty(QStringLiteral("next"), method_next, 0); + + Scope scope(e); + ScopedString val(scope, e->newString(QLatin1String("Map Iterator"))); + defineReadonlyConfigurableProperty(e->symbol_toStringTag(), val); +} + +ReturnedValue MapIteratorPrototype::method_next(const FunctionObject *b, const Value *that, const Value *, int) +{ + Scope scope(b); + const MapIteratorObject *thisObject = that->as(); + if (!thisObject) + return scope.engine->throwTypeError(QLatin1String("Not a Map Iterator instance")); + + Scoped s(scope, thisObject->d()->iteratedMap); + quint32 index = thisObject->d()->mapNextIndex; + IteratorKind itemKind = thisObject->d()->iterationKind; + + if (!s) { + QV4::Value undefined = Primitive::undefinedValue(); + return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); + } + + Scoped keys(scope, s->d()->mapKeys); + Scoped values(scope, s->d()->mapValues); + + while (index < keys->getLength()) { + ScopedValue sk(scope, keys->getIndexed(index)); + ScopedValue sv(scope, values->getIndexed(index)); + index += 1; + thisObject->d()->mapNextIndex = index; + + ScopedValue result(scope); + + if (itemKind == KeyIteratorKind) { + result = sk; + } else if (itemKind == ValueIteratorKind) { + result = sv; + } else { + Q_ASSERT(itemKind == KeyValueIteratorKind); + + result = scope.engine->newArrayObject(); + + Scoped resultArray(scope, result); + resultArray->arrayReserve(2); + resultArray->arrayPut(0, sk); + resultArray->arrayPut(1, sv); + resultArray->setArrayLengthUnchecked(2); + } + + return IteratorPrototype::createIterResultObject(scope.engine, result, false); + } + + thisObject->d()->iteratedMap.set(scope.engine, nullptr); + QV4::Value undefined = Primitive::undefinedValue(); + return IteratorPrototype::createIterResultObject(scope.engine, undefined, true); +} + + diff --git a/src/qml/jsruntime/qv4mapiterator_p.h b/src/qml/jsruntime/qv4mapiterator_p.h new file mode 100644 index 0000000000..836ba14663 --- /dev/null +++ b/src/qml/jsruntime/qv4mapiterator_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Crimson AS +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QV4MAPITERATOR_P_H +#define QV4MAPITERATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qv4object_p.h" +#include "qv4iterator_p.h" + +QT_BEGIN_NAMESPACE + +namespace QV4 { + +namespace Heap { + +#define MapIteratorObjectMembers(class, Member) \ + Member(class, Pointer, Object *, iteratedMap) \ + Member(class, NoMark, IteratorKind, iterationKind) \ + Member(class, NoMark, quint32, mapNextIndex) + +DECLARE_HEAP_OBJECT(MapIteratorObject, Object) { + DECLARE_MARKOBJECTS(MapIteratorObject); + void init(Object *obj, QV4::ExecutionEngine *engine) + { + Object::init(); + this->iteratedMap.set(engine, obj); + this->mapNextIndex = 0; + } +}; + +} + +struct MapIteratorPrototype : Object +{ + V4_PROTOTYPE(iteratorPrototype) + void init(ExecutionEngine *engine); + + static ReturnedValue method_next(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc); +}; + +struct MapIteratorObject : Object +{ + V4_OBJECT2(MapIteratorObject, Object) + Q_MANAGED_TYPE(MapIteratorObject) + V4_PROTOTYPE(mapIteratorPrototype) + + void init(ExecutionEngine *engine); +}; + + +} + +QT_END_NAMESPACE + +#endif // QV4MAPITERATOR_P_H + + diff --git a/src/qml/jsruntime/qv4mapobject.cpp b/src/qml/jsruntime/qv4mapobject.cpp new file mode 100644 index 0000000000..e3ca75b951 --- /dev/null +++ b/src/qml/jsruntime/qv4mapobject.cpp @@ -0,0 +1,354 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Crimson AS +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qv4setobject_p.h" // ### temporary +#include "qv4mapobject_p.h" +#include "qv4mapiterator_p.h" +#include "qv4symbol_p.h" + +using namespace QV4; + +DEFINE_OBJECT_VTABLE(MapCtor); +DEFINE_OBJECT_VTABLE(MapObject); + +void Heap::MapCtor::init(QV4::ExecutionContext *scope) +{ + Heap::FunctionObject::init(scope, QStringLiteral("Map")); +} + +ReturnedValue MapCtor::callAsConstructor(const FunctionObject *f, const Value *argv, int argc) +{ + Scope scope(f); + Scoped a(scope, scope.engine->memoryManager->allocate()); + a->d()->mapKeys.set(scope.engine, scope.engine->newArrayObject()); + a->d()->mapValues.set(scope.engine, scope.engine->newArrayObject()); + + if (argc > 0) { + ScopedValue iterable(scope, argv[0]); + + // ### beware, hack alert! + // Object iteration seems broken right now. if we allow any object to + // iterate, it endlessly loops in the Map/prototype tests in test262... + // disable these for now until Object iteration is fixed, just so we can + // test this. + Scoped mapObjectCheck(scope, argv[0]); + Scoped setObjectCheck(scope, argv[0]); + + if (!iterable->isUndefined() && !iterable->isNull() && (mapObjectCheck || setObjectCheck)) { + + + ScopedFunctionObject adder(scope, a->get(ScopedString(scope, scope.engine->newString(QString::fromLatin1("set"))))); + if (!adder) { + return scope.engine->throwTypeError(); + } + ScopedObject iter(scope, Runtime::method_getIterator(scope.engine, iterable, true)); + + CHECK_EXCEPTION(); + if (!iter) { + return a.asReturnedValue(); + } + + Value *nextValue = scope.alloc(1); + ScopedValue done(scope); + forever { + done = Runtime::method_iteratorNext(scope.engine, iter, nextValue); + CHECK_EXCEPTION(); + if (done->toBoolean()) { + return a.asReturnedValue(); + } + + adder->call(a, nextValue, 1); + if (scope.engine->hasException) { + ScopedValue falsey(scope, Encode(false)); + return Runtime::method_iteratorClose(scope.engine, iter, falsey); + } + } + } + } + return a.asReturnedValue(); +} + +ReturnedValue MapCtor::call(const FunctionObject *f, const Value *, const Value *, int) +{ + Scope scope(f); + return scope.engine->throwTypeError(QString::fromLatin1("Map requires new")); +} + +void MapPrototype::init(ExecutionEngine *engine, Object *ctor) +{ + Scope scope(engine); + ScopedObject o(scope); + ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(0)); + ctor->defineReadonlyProperty(engine->id_prototype(), (o = this)); + ctor->addSymbolSpecies(); + defineDefaultProperty(engine->id_constructor(), (o = ctor)); + + defineDefaultProperty(QStringLiteral("clear"), method_clear, 0); + defineDefaultProperty(QStringLiteral("delete"), method_delete, 1); + defineDefaultProperty(QStringLiteral("forEach"), method_forEach, 1); + defineDefaultProperty(QStringLiteral("get"), method_get, 1); + defineDefaultProperty(QStringLiteral("has"), method_has, 1); + defineDefaultProperty(QStringLiteral("keys"), method_keys, 0); + defineDefaultProperty(QStringLiteral("set"), method_set, 0); + defineAccessorProperty(QStringLiteral("size"), method_get_size, nullptr); + defineDefaultProperty(QStringLiteral("values"), method_values, 0); + + // Per the spec, the value for entries/@@iterator is the same + ScopedString valString(scope, scope.engine->newIdentifier(QStringLiteral("entries"))); + ScopedFunctionObject entriesFn(scope, FunctionObject::createBuiltinFunction(engine, valString, MapPrototype::method_entries, 0)); + defineDefaultProperty(QStringLiteral("entries"), entriesFn); + defineDefaultProperty(engine->symbol_iterator(), entriesFn); + + ScopedString val(scope, engine->newString(QLatin1String("Map"))); + defineReadonlyConfigurableProperty(engine->symbol_toStringTag(), val); +} + +ReturnedValue MapPrototype::method_clear(const FunctionObject *b, const Value *thisObject, const Value *, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + that->d()->mapKeys.set(scope.engine, scope.engine->newArrayObject()); + that->d()->mapValues.set(scope.engine, scope.engine->newArrayObject()); + return Encode::undefined(); +} + +// delete value +ReturnedValue MapPrototype::method_delete(const FunctionObject *b, const Value *thisObject, const Value *argv, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped keys(scope, that->d()->mapKeys); + qint64 len = keys->getLength(); + + bool found = false; + int idx = 0; + ScopedValue sk(scope); + + for (; idx < len; ++idx) { + sk = keys->getIndexed(idx); + if (sk->sameValueZero(argv[0])) { + found = true; + break; + } + } + + if (found == true) { + Scoped values(scope, that->d()->mapValues); + Scoped newKeys(scope, scope.engine->newArrayObject()); + Scoped newValues(scope, scope.engine->newArrayObject()); + for (int j = 0, newIdx = 0; j < len; ++j, newIdx++) { + if (j == idx) { + newIdx--; // skip the entry + continue; + } + newKeys->putIndexed(newIdx, ScopedValue(scope, keys->getIndexed(j))); + newValues->putIndexed(newIdx, ScopedValue(scope, values->getIndexed(j))); + } + + that->d()->mapKeys.set(scope.engine, newKeys->d()); + that->d()->mapValues.set(scope.engine, newValues->d()); + return Encode(true); + } else { + return Encode(false); + } +} + +ReturnedValue MapPrototype::method_entries(const FunctionObject *b, const Value *thisObject, const Value *, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped ao(scope, scope.engine->newMapIteratorObject(that)); + ao->d()->iterationKind = IteratorKind::KeyValueIteratorKind; + return ao->asReturnedValue(); +} + +ReturnedValue MapPrototype::method_forEach(const FunctionObject *b, const Value *thisObject, const Value *argv, int argc) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + ScopedFunctionObject callbackfn(scope, argv[0]); + if (!callbackfn) + return scope.engine->throwTypeError(); + + ScopedValue thisArg(scope, Primitive::undefinedValue()); + if (argc > 1) + thisArg = ScopedValue(scope, argv[1]); + + Scoped keys(scope, that->d()->mapKeys); + Scoped values(scope, that->d()->mapKeys); + qint64 len = keys->getLength(); + + Value *arguments = scope.alloc(3); + ScopedValue sk(scope); + ScopedValue sv(scope); + for (int i = 0; i < len; ++i) { + sk = keys->getIndexed(i); + sv = values->getIndexed(i); + + arguments[0] = sv; + arguments[1] = sk; + arguments[2] = that; + callbackfn->call(thisArg, arguments, 3); + CHECK_EXCEPTION(); + } + return Encode::undefined(); +} + +ReturnedValue MapPrototype::method_get(const FunctionObject *b, const Value *thisObject, const Value *argv, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped keys(scope, that->d()->mapKeys); + ScopedValue sk(scope); + qint64 len = keys->getLength(); + + for (int i = 0; i < len; ++i) { + sk = keys->getIndexed(i); + if (sk->sameValueZero(argv[0])) { + Scoped values(scope, that->d()->mapValues); + return values->getIndexed(i); + } + } + + return Encode::undefined(); +} + +ReturnedValue MapPrototype::method_has(const FunctionObject *b, const Value *thisObject, const Value *argv, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped keys(scope, that->d()->mapKeys); + ScopedValue sk(scope); + qint64 len = keys->getLength(); + + for (int i = 0; i < len; ++i) { + sk = keys->getIndexed(i); + if (sk->sameValueZero(argv[0])) + return Encode(true); + } + + return Encode(false); +} + +ReturnedValue MapPrototype::method_keys(const FunctionObject *b, const Value *thisObject, const Value *, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped ao(scope, scope.engine->newMapIteratorObject(that)); + ao->d()->iterationKind = IteratorKind::KeyIteratorKind; + return ao->asReturnedValue(); +} + +ReturnedValue MapPrototype::method_set(const FunctionObject *b, const Value *thisObject, const Value *argv, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped keys(scope, that->d()->mapKeys); + Scoped values(scope, that->d()->mapValues); + ScopedValue sk(scope, argv[1]); + qint64 len = keys->getLength(); + + for (int i = 0; i < len; ++i) { + sk = keys->getIndexed(i); + if (sk->sameValueZero(argv[0])) { + values->putIndexed(len, argv[1]); + return that.asReturnedValue(); + } + } + + sk = argv[0]; + if (sk->isDouble()) { + if (sk->doubleValue() == 0 && std::signbit(sk->doubleValue())) + sk = Primitive::fromDouble(+0); + } + + keys->putIndexed(len, sk); + values->putIndexed(len, argv[1]); + return that.asReturnedValue(); +} + +ReturnedValue MapPrototype::method_get_size(const FunctionObject *b, const Value *thisObject, const Value *, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped keys(scope, that->d()->mapKeys); + qint64 len = keys->getLength(); + return Encode((uint)len); +} + +ReturnedValue MapPrototype::method_values(const FunctionObject *b, const Value *thisObject, const Value *, int) +{ + Scope scope(b); + Scoped that(scope, thisObject); + if (!that) + return scope.engine->throwTypeError(); + + Scoped ao(scope, scope.engine->newMapIteratorObject(that)); + ao->d()->iterationKind = IteratorKind::ValueIteratorKind; + return ao->asReturnedValue(); +} + + diff --git a/src/qml/jsruntime/qv4mapobject_p.h b/src/qml/jsruntime/qv4mapobject_p.h new file mode 100644 index 0000000000..9c64e25c3d --- /dev/null +++ b/src/qml/jsruntime/qv4mapobject_p.h @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2018 Crimson AS +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QV4MAPOBJECT_P_H +#define QV4MAPOBJECT_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qv4object_p.h" +#include "qv4objectproto_p.h" +#include "qv4functionobject_p.h" +#include "qv4string_p.h" + +QT_BEGIN_NAMESPACE + +namespace QV4 { + +namespace Heap { + +struct MapCtor : FunctionObject { + void init(QV4::ExecutionContext *scope); +}; + +#define MapObjectMembers(class, Member) \ + Member(class, Pointer, ArrayObject *, mapKeys) \ + Member(class, Pointer, ArrayObject *, mapValues) + +DECLARE_HEAP_OBJECT(MapObject, Object) { + DECLARE_MARKOBJECTS(MapObject); + void init() { Object::init(); } +}; + +} + +struct MapCtor: FunctionObject +{ + V4_OBJECT2(MapCtor, FunctionObject) + + static ReturnedValue callAsConstructor(const FunctionObject *f, const Value *argv, int argc); + static ReturnedValue call(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc); +}; + +struct MapObject : Object +{ + V4_OBJECT2(MapObject, Object) + V4_PROTOTYPE(mapPrototype) +}; + +struct MapPrototype : Object +{ + void init(ExecutionEngine *engine, Object *ctor); + + static ReturnedValue method_clear(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_delete(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_entries(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_forEach(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_get(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_has(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_keys(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_set(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_get_size(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); + static ReturnedValue method_values(const FunctionObject *, const Value *thisObject, const Value *argv, int argc); +}; + + +} // namespace QV4 + + +QT_END_NAMESPACE + +#endif // QV4MAPOBJECT_P_H + diff --git a/tests/auto/qml/ecmascripttests/TestExpectations b/tests/auto/qml/ecmascripttests/TestExpectations index 6db3a0571f..5a845d19ab 100644 --- a/tests/auto/qml/ecmascripttests/TestExpectations +++ b/tests/auto/qml/ecmascripttests/TestExpectations @@ -520,13 +520,6 @@ built-ins/JSON/stringify/replacer-proxy-revoked.js fails built-ins/JSON/stringify/replacer-proxy.js fails built-ins/JSON/stringify/value-proxy-revoked.js fails built-ins/JSON/stringify/value-proxy.js fails -built-ins/Map/Symbol.species/length.js fails -built-ins/Map/Symbol.species/return-value.js fails -built-ins/Map/Symbol.species/symbol-species-name.js fails -built-ins/Map/Symbol.species/symbol-species.js fails -built-ins/Map/constructor.js fails -built-ins/Map/does-not-throw-when-set-is-not-callable.js fails -built-ins/Map/get-set-method-failure.js fails built-ins/Map/iterable-calls-set.js fails built-ins/Map/iterator-close-after-set-failure.js fails built-ins/Map/iterator-is-undefined-throws.js fails @@ -534,147 +527,31 @@ built-ins/Map/iterator-item-first-entry-returns-abrupt.js fails built-ins/Map/iterator-item-second-entry-returns-abrupt.js fails built-ins/Map/iterator-items-are-not-object-close-iterator.js fails built-ins/Map/iterator-items-are-not-object.js fails -built-ins/Map/iterator-next-failure.js fails -built-ins/Map/iterator-value-failure.js fails -built-ins/Map/length.js fails -built-ins/Map/map-iterable-empty-does-not-call-set.js fails built-ins/Map/map-iterable-throws-when-set-is-not-callable.js fails built-ins/Map/map-iterable.js fails -built-ins/Map/map-no-iterable-does-not-call-set.js fails -built-ins/Map/map-no-iterable.js fails -built-ins/Map/map.js fails -built-ins/Map/name.js fails -built-ins/Map/newtarget.js fails -built-ins/Map/properties-of-map-instances.js fails -built-ins/Map/properties-of-the-map-prototype-object.js fails built-ins/Map/proto-from-ctor-realm.js fails -built-ins/Map/prototype-of-map.js fails -built-ins/Map/prototype/Symbol.iterator.js fails -built-ins/Map/prototype/Symbol.toStringTag.js fails -built-ins/Map/prototype/clear/clear-map.js fails -built-ins/Map/prototype/clear/clear.js fails -built-ins/Map/prototype/clear/context-is-not-map-object.js fails -built-ins/Map/prototype/clear/context-is-not-object.js fails -built-ins/Map/prototype/clear/context-is-set-object-throws.js fails built-ins/Map/prototype/clear/context-is-weakmap-object-throws.js fails -built-ins/Map/prototype/clear/length.js fails -built-ins/Map/prototype/clear/map-data-list-is-preserved.js fails -built-ins/Map/prototype/clear/name.js fails -built-ins/Map/prototype/clear/returns-undefined.js fails -built-ins/Map/prototype/constructor.js fails -built-ins/Map/prototype/delete/context-is-not-map-object.js fails -built-ins/Map/prototype/delete/context-is-not-object.js fails -built-ins/Map/prototype/delete/context-is-set-object-throws.js fails built-ins/Map/prototype/delete/context-is-weakmap-object-throws.js fails -built-ins/Map/prototype/delete/delete.js fails built-ins/Map/prototype/delete/does-not-break-iterators.js fails -built-ins/Map/prototype/delete/length.js fails -built-ins/Map/prototype/delete/name.js fails -built-ins/Map/prototype/delete/returns-false.js fails built-ins/Map/prototype/delete/returns-true-for-deleted-entry.js fails -built-ins/Map/prototype/descriptor.js fails -built-ins/Map/prototype/entries/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/entries/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/entries/does-not-have-mapdata-internal-slot.js fails -built-ins/Map/prototype/entries/entries.js fails -built-ins/Map/prototype/entries/length.js fails -built-ins/Map/prototype/entries/name.js fails -built-ins/Map/prototype/entries/returns-iterator-empty.js fails -built-ins/Map/prototype/entries/returns-iterator.js fails -built-ins/Map/prototype/entries/this-not-object-throw.js fails built-ins/Map/prototype/forEach/callback-parameters.js fails -built-ins/Map/prototype/forEach/callback-result-is-abrupt.js sloppyFails -built-ins/Map/prototype/forEach/callback-this-non-strict.js sloppyFails -built-ins/Map/prototype/forEach/callback-this-strict.js strictFails built-ins/Map/prototype/forEach/deleted-values-during-foreach.js fails -built-ins/Map/prototype/forEach/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/forEach/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/forEach/does-not-have-mapdata-internal-slot.js fails -built-ins/Map/prototype/forEach/first-argument-is-not-callable.js fails -built-ins/Map/prototype/forEach/forEach.js fails built-ins/Map/prototype/forEach/iterates-in-key-insertion-order.js fails built-ins/Map/prototype/forEach/iterates-values-added-after-foreach-begins.js fails built-ins/Map/prototype/forEach/iterates-values-deleted-then-readded.js fails -built-ins/Map/prototype/forEach/length.js fails -built-ins/Map/prototype/forEach/name.js fails -built-ins/Map/prototype/forEach/return-undefined.js fails -built-ins/Map/prototype/forEach/second-parameter-as-callback-context.js fails -built-ins/Map/prototype/forEach/this-not-object-throw.js fails -built-ins/Map/prototype/get/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/get/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/get/does-not-have-mapdata-internal-slot.js fails -built-ins/Map/prototype/get/get.js fails -built-ins/Map/prototype/get/length.js fails -built-ins/Map/prototype/get/name.js fails -built-ins/Map/prototype/get/returns-undefined.js fails -built-ins/Map/prototype/get/returns-value-different-key-types.js fails -built-ins/Map/prototype/get/returns-value-normalized-zero-key.js fails -built-ins/Map/prototype/get/this-not-object-throw.js fails -built-ins/Map/prototype/has/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/has/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/has/does-not-have-mapdata-internal-slot.js fails -built-ins/Map/prototype/has/has.js fails -built-ins/Map/prototype/has/length.js fails -built-ins/Map/prototype/has/name.js fails -built-ins/Map/prototype/has/normalizes-zero-key.js fails -built-ins/Map/prototype/has/return-false-different-key-types.js fails -built-ins/Map/prototype/has/return-true-different-key-types.js fails -built-ins/Map/prototype/has/this-not-object-throw.js fails -built-ins/Map/prototype/keys/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/keys/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/keys/does-not-have-mapdata-internal-slot.js fails -built-ins/Map/prototype/keys/keys.js fails -built-ins/Map/prototype/keys/length.js fails -built-ins/Map/prototype/keys/name.js fails -built-ins/Map/prototype/keys/returns-iterator-empty.js fails -built-ins/Map/prototype/keys/returns-iterator.js fails -built-ins/Map/prototype/keys/this-not-object-throw.js fails -built-ins/Map/prototype/set/append-new-values-normalizes-zero-key.js fails -built-ins/Map/prototype/set/append-new-values-return-map.js fails built-ins/Map/prototype/set/append-new-values.js fails -built-ins/Map/prototype/set/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/set/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/set/does-not-have-mapdata-internal-slot.js fails built-ins/Map/prototype/set/length.js fails -built-ins/Map/prototype/set/name.js fails -built-ins/Map/prototype/set/replaces-a-value-normalizes-zero-key.js fails -built-ins/Map/prototype/set/replaces-a-value-returns-map.js fails -built-ins/Map/prototype/set/replaces-a-value.js fails -built-ins/Map/prototype/set/set.js fails -built-ins/Map/prototype/set/this-not-object-throw.js fails -built-ins/Map/prototype/size/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/size/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/size/does-not-have-mapdata-internal-slot.js fails -built-ins/Map/prototype/size/length.js fails built-ins/Map/prototype/size/name.js fails -built-ins/Map/prototype/size/returns-count-of-present-values-before-after-set-clear.js fails -built-ins/Map/prototype/size/returns-count-of-present-values-before-after-set-delete.js fails -built-ins/Map/prototype/size/returns-count-of-present-values-by-insertion.js fails built-ins/Map/prototype/size/returns-count-of-present-values-by-iterable.js fails built-ins/Map/prototype/size/size.js fails -built-ins/Map/prototype/size/this-not-object-throw.js fails -built-ins/Map/prototype/values/does-not-have-mapdata-internal-slot-set.js fails built-ins/Map/prototype/values/does-not-have-mapdata-internal-slot-weakmap.js fails -built-ins/Map/prototype/values/does-not-have-mapdata-internal-slot.js fails -built-ins/Map/prototype/values/length.js fails -built-ins/Map/prototype/values/name.js fails -built-ins/Map/prototype/values/returns-iterator-empty.js fails -built-ins/Map/prototype/values/returns-iterator.js fails -built-ins/Map/prototype/values/this-not-object-throw.js fails -built-ins/Map/prototype/values/values.js fails -built-ins/Map/symbol-as-entry-key.js fails -built-ins/Map/undefined-newtarget.js fails -built-ins/MapIteratorPrototype/Symbol.toStringTag.js fails -built-ins/MapIteratorPrototype/next/does-not-have-mapiterator-internal-slots-map.js fails -built-ins/MapIteratorPrototype/next/does-not-have-mapiterator-internal-slots.js fails -built-ins/MapIteratorPrototype/next/iteration-mutable.js fails -built-ins/MapIteratorPrototype/next/iteration.js fails -built-ins/MapIteratorPrototype/next/length.js fails -built-ins/MapIteratorPrototype/next/name.js fails -built-ins/MapIteratorPrototype/next/this-not-object-throw-entries.js fails -built-ins/MapIteratorPrototype/next/this-not-object-throw-keys.js fails -built-ins/MapIteratorPrototype/next/this-not-object-throw-prototype-iterator.js fails -built-ins/MapIteratorPrototype/next/this-not-object-throw-values.js fails built-ins/Math/Symbol.toStringTag.js fails built-ins/Math/acosh/arg-is-infinity.js fails built-ins/Math/acosh/arg-is-one.js fails @@ -1643,25 +1520,18 @@ built-ins/RegExp/u180e.js fails built-ins/RegExp/unicode_identity_escape.js fails built-ins/RegExp/valid-flags-y.js fails built-ins/Set/proto-from-ctor-realm.js fails -built-ins/Set/prototype/add/does-not-have-setdata-internal-slot-map.js fails built-ins/Set/prototype/add/does-not-have-setdata-internal-slot-weakset.js fails -built-ins/Set/prototype/clear/does-not-have-setdata-internal-slot-map.js fails built-ins/Set/prototype/clear/does-not-have-setdata-internal-slot-weakset.js fails -built-ins/Set/prototype/delete/does-not-have-setdata-internal-slot-map.js fails built-ins/Set/prototype/delete/does-not-have-setdata-internal-slot-weakset.js fails -built-ins/Set/prototype/entries/does-not-have-setdata-internal-slot-map.js fails built-ins/Set/prototype/entries/does-not-have-setdata-internal-slot-weakset.js fails -built-ins/Set/prototype/forEach/does-not-have-setdata-internal-slot-map.js fails built-ins/Set/prototype/forEach/does-not-have-setdata-internal-slot-weakset.js fails built-ins/Set/prototype/forEach/iterates-values-added-after-foreach-begins.js fails built-ins/Set/prototype/forEach/iterates-values-deleted-then-readded.js fails built-ins/Set/prototype/forEach/iterates-values-revisits-after-delete-re-add.js fails built-ins/Set/prototype/forEach/this-arg-explicit-cannot-override-lexical-this-arrow.js fails -built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-map.js fails built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js fails built-ins/Set/prototype/size/name.js fails built-ins/Set/prototype/size/size.js fails -built-ins/Set/prototype/values/does-not-have-setdata-internal-slot-map.js fails built-ins/Set/prototype/values/does-not-have-setdata-internal-slot-weakset.js fails built-ins/SharedArrayBuffer/allocation-limit.js fails built-ins/SharedArrayBuffer/data-allocation-after-object-creation.js fails @@ -5399,11 +5269,6 @@ language/statements/for-of/iterator-close-via-return.js fails language/statements/for-of/iterator-close-via-throw.js fails language/statements/for-of/iterator-next-reference.js fails language/statements/for-of/iterator-next-result-type.js fails -language/statements/for-of/map-contract-expand.js fails -language/statements/for-of/map-contract.js fails -language/statements/for-of/map-expand-contract.js fails -language/statements/for-of/map-expand.js fails -language/statements/for-of/map.js fails language/statements/for-of/scope-body-lex-open.js fails language/statements/for-of/scope-head-lex-close.js fails language/statements/for-of/scope-head-lex-open.js fails diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp index dc3db2958c..42ee089bb5 100644 --- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp +++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp @@ -970,6 +970,7 @@ void tst_QJSEngine::globalObjectProperties_enumerate() << "Float32Array" << "Float64Array" << "Set" + << "Map" ; QSet actualNames; { -- cgit v1.2.3