aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <[email protected]>2018-04-26 13:12:38 +0200
committerLars Knoll <[email protected]>2018-05-02 14:20:29 +0000
commit8761cbd4f7aada5a976831ff404b004f537a660b (patch)
tree5b5b258178c99e0d77cc84a2e8c31df41f98415b /src/qml/jsruntime/qv4engine.cpp
parent7d46d7251032ea31f7e7dcef4855a0e5d669fed5 (diff)
Implement StringIterator
Add support for String.prototype[Symbol.iterator] and the StringIterator object. Change-Id: I72c4f988e4f363be1af51f9cc5f8e83af43cd151 Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index c8fb568ad1..1c3c3e7ff8 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -66,6 +66,7 @@
#include "qv4profiling_p.h"
#include "qv4executableallocator_p.h"
#include "qv4iterator_p.h"
+#include "qv4stringiterator_p.h"
#if QT_CONFIG(qml_sequence_object)
#include "qv4sequenceobject_p.h"
@@ -407,6 +408,7 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
jsObjects[URIError_Ctor] = memoryManager->allocate<URIErrorCtor>(global);
jsObjects[IteratorProto] = memoryManager->allocate<IteratorPrototype>();
jsObjects[ArrayIteratorProto] = memoryManager->allocObject<ArrayIteratorPrototype>(newInternalClass(ArrayIteratorPrototype::staticVTable(), iteratorPrototype()));
+ jsObjects[StringIteratorProto] = memoryManager->allocObject<StringIteratorPrototype>(newInternalClass(StringIteratorPrototype::staticVTable(), iteratorPrototype()));
static_cast<ObjectPrototype *>(objectPrototype())->init(this, objectCtor());
static_cast<StringPrototype *>(stringPrototype())->init(this, stringCtor());
@@ -428,6 +430,8 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine)
static_cast<IteratorPrototype *>(iteratorPrototype())->init(this);
static_cast<ArrayIteratorPrototype *>(arrayIteratorPrototype())->init(this);
+ static_cast<StringIteratorPrototype *>(stringIteratorPrototype())->init(this);
+
static_cast<VariantPrototype *>(variantPrototype())->init();
#if QT_CONFIG(qml_sequence_object)