typeErrorPrototype->init(this, typeErrorCtor);
uRIErrorPrototype->init(this, uRIErrorCtor);
- variantPrototype->initClass(this);
+ variantPrototype->init(this);
sequencePrototype->init(this);
//
prototype = engine->objectPrototype;
}
+void VariantPrototype::init(ExecutionEngine *engine)
+{
+ defineDefaultProperty(engine, QStringLiteral("preserve"), method_preserve, 0);
+ defineDefaultProperty(engine, QStringLiteral("destroy"), method_destroy, 0);
+ defineDefaultProperty(engine, QStringLiteral("valueOf"), method_valueOf, 0);
+ defineDefaultProperty(engine, QStringLiteral("toString"), method_toString, 0);
+}
+
QV4::Value VariantPrototype::method_preserve(SimpleCallContext *ctx)
{
VariantObject *o = ctx->thisObject.as<QV4::VariantObject>();
return ctx->thisObject;
}
-#include "qv4variantobject_p_jsclass.cpp"
-
QT_END_NAMESPACE
static bool isEqualTo(Managed *m, Managed *other);
};
-struct QV4_JS_CLASS(VariantPrototype) : VariantObject
+struct VariantPrototype : VariantObject
{
public:
VariantPrototype(ExecutionEngine *engine);
- void initClass(ExecutionEngine *engine);
+ void init(ExecutionEngine *engine);
static Value method_preserve(SimpleCallContext *ctx);
static Value method_destroy(SimpleCallContext *ctx);
OTHER_FILES += \
$$PWD/v4classgen
-JS_CLASS_SOURCES += $$PWD/qv4dateobject_p.h \
- $$PWD/qv4variantobject_p.h
+JS_CLASS_SOURCES += $$PWD/qv4dateobject_p.h
js_class_bindings.output = ${QMAKE_FILE_BASE}_jsclass.cpp
js_class_bindings.input = JS_CLASS_SOURCES