From bab5e5adf578fb37402ff03f4bd5e9ed3ce4c2d2 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 3 Apr 2018 15:23:07 +0200 Subject: Partial Symbol support Added basic infrastructure to create symbols and convert them back to strings. In addition, storing and retrieving of symbol based properties in Objects works. Change-Id: I185f7aa46e7afa19db5a801102142892e03b7bf1 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4engine_p.h | 4 ++++ 1 file changed, 4 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 4316967484..ff767a3dde 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -161,6 +161,7 @@ public: RootContext, IntegerNull, // Has to come after the RootContext to make the context stack safe ObjectProto, + SymbolProto, ArrayProto, PropertyListProto, StringProto, @@ -187,6 +188,7 @@ public: Object_Ctor, String_Ctor, + Symbol_Ctor, Number_Ctor, Boolean_Ctor, Array_Ctor, @@ -214,6 +216,7 @@ public: ExecutionContext *rootContext() const { return reinterpret_cast(jsObjects + RootContext); } FunctionObject *objectCtor() const { return reinterpret_cast(jsObjects + Object_Ctor); } FunctionObject *stringCtor() const { return reinterpret_cast(jsObjects + String_Ctor); } + FunctionObject *symbolCtor() const { return reinterpret_cast(jsObjects + Symbol_Ctor); } FunctionObject *numberCtor() const { return reinterpret_cast(jsObjects + Number_Ctor); } FunctionObject *booleanCtor() const { return reinterpret_cast(jsObjects + Boolean_Ctor); } FunctionObject *arrayCtor() const { return reinterpret_cast(jsObjects + Array_Ctor); } @@ -232,6 +235,7 @@ public: FunctionObject *typedArrayCtors; Object *objectPrototype() const { return reinterpret_cast(jsObjects + ObjectProto); } + Object *symbolPrototype() const { return reinterpret_cast(jsObjects + SymbolProto); } Object *arrayPrototype() const { return reinterpret_cast(jsObjects + ArrayProto); } Object *propertyListPrototype() const { return reinterpret_cast(jsObjects + PropertyListProto); } Object *stringPrototype() const { return reinterpret_cast(jsObjects + StringProto); } -- cgit v1.2.3