diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-14 23:07:45 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-15 18:21:10 +0000 |
commit | cc8cb4b442fe28f1b601d6f1f27e8c59231007be (patch) | |
tree | fd5c2a0039691eace1e6af804578b7db0107817c /src/qml/jsruntime/qv4object.cpp | |
parent | 3fae4819d33d22039f01ce26e1549b5d0fcc96cf (diff) |
Implement Symbol.species getter functions
Change-Id: I18b3e382e679f95d7cb53b4ed03be2513ea0204b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 586fa1ee4b..cf988f093a 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -50,6 +50,7 @@ #include "qv4string_p.h" #include "qv4identifiertable_p.h" #include "qv4jscall_p.h" +#include "qv4symbol_p.h" #include <stdint.h> @@ -221,6 +222,15 @@ void Object::defineReadonlyConfigurableProperty(StringOrSymbol *name, const Valu insertMember(name, value, Attr_ReadOnly_ButConfigurable); } +void Object::addSymbolSpecies() +{ + Scope scope(engine()); + ScopedProperty p(scope); + p->setGetter(scope.engine->getSymbolSpecies()); + p->setSetter(nullptr); + insertMember(scope.engine->symbol_species(), p, QV4::Attr_Accessor|QV4::Attr_NotWritable|QV4::Attr_NotEnumerable); +} + void Heap::Object::markObjects(Heap::Base *b, MarkStack *stack) { Base::markObjects(b, stack); |