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/qv4engine_p.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/qml/jsruntime/qv4engine_p.h') 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; -- cgit v1.2.3