aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4symbol_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-04-08 16:43:10 +0200
committerLars Knoll <lars.knoll@qt.io>2018-05-02 14:18:45 +0000
commit37b85ca10eef7236dbea0decd265c40fa8d0caf1 (patch)
treeed3343cd350dff8aa3be1d471c745775ae523855 /src/qml/jsruntime/qv4symbol_p.h
parent360a48aa3f5346aa7aaff741e4ef8f5dc8701f51 (diff)
Add SymbolObject, well known symbols and fix most remaining issues
Added SymbolObject, the equivalent to StringObject which was still missing so far. Added the predefined standard symbols, and fixed most test failures related to symbols. Change-Id: I1e28b439e7c4f5141b4a09bd8fb666c60691f192 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4symbol_p.h')
-rw-r--r--src/qml/jsruntime/qv4symbol_p.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4symbol_p.h b/src/qml/jsruntime/qv4symbol_p.h
index 6ff60d22db..3cf6bc5dde 100644
--- a/src/qml/jsruntime/qv4symbol_p.h
+++ b/src/qml/jsruntime/qv4symbol_p.h
@@ -68,6 +68,14 @@ struct Symbol : StringOrSymbol {
void init(const QString &s);
};
+#define SymbolObjectMembers(class, Member) \
+ Member(class, Pointer, Symbol *, symbol)
+
+DECLARE_HEAP_OBJECT(SymbolObject, Object) {
+ DECLARE_MARKOBJECTS(SymbolObject);
+ void init(const QV4::Symbol *s);
+};
+
}
struct SymbolCtor : FunctionObject
@@ -86,6 +94,8 @@ struct SymbolPrototype : Object
static ReturnedValue method_toString(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
static ReturnedValue method_valueOf(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
+
+ static ReturnedValue method_symbolToPrimitive(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
};
struct Symbol : StringOrSymbol
@@ -100,6 +110,18 @@ struct Symbol : StringOrSymbol
QString descriptiveString() const;
};
+struct SymbolObject : Object
+{
+ V4_OBJECT2(SymbolObject, Object)
+ Q_MANAGED_TYPE(SymbolObject)
+ V4_INTERNALCLASS(SymbolObject)
+ V4_PROTOTYPE(symbolPrototype)
+
+ static bool put(Managed *, StringOrSymbol *, const Value &) { return false; }
+ static bool putIndexed(Managed *, uint, const Value &) { return false; }
+
+};
+
}
QT_END_NAMESPACE