diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-01-20 13:51:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-21 20:46:50 +0100 |
commit | 7d4fc70e70ca566900c01aa7c5e3ec4770d15933 (patch) | |
tree | 8b223bae1ab0604788abae489e87ec2fbd5298e8 /tools/qmljs | |
parent | 3efae4fc7fff96f147f79013ef9fff9c31557229 (diff) |
Split ManagedVTable into two classes
Keep the basic methods in ManagedVTable, but have
the Object related stuff in an ObjectVTable class.
Change-Id: I9b068acf3caef813686227b8d935e7df1a7d1a6e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tools/qmljs')
-rw-r--r-- | tools/qmljs/main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/qmljs/main.cpp b/tools/qmljs/main.cpp index 9c10851b21..c5c94773b9 100644 --- a/tools/qmljs/main.cpp +++ b/tools/qmljs/main.cpp @@ -71,8 +71,9 @@ using namespace QV4; struct Print: FunctionObject { + V4_OBJECT Print(ExecutionContext *scope): FunctionObject(scope, QStringLiteral("print")) { - setVTable(&static_vtbl); + setVTable(staticVTable()); } static ReturnedValue call(Managed *, CallData *callData) @@ -86,29 +87,26 @@ struct Print: FunctionObject std::cout << std::endl; return Encode::undefined(); } - - static const ManagedVTable static_vtbl; }; -DEFINE_MANAGED_VTABLE(Print); +DEFINE_OBJECT_VTABLE(Print); struct GC: public FunctionObject { + V4_OBJECT GC(ExecutionContext* scope) : FunctionObject(scope, QStringLiteral("gc")) { - setVTable(&static_vtbl); + setVTable(staticVTable()); } static ReturnedValue call(Managed *m, CallData *) { m->engine()->memoryManager->runGC(); return Encode::undefined(); } - - static const ManagedVTable static_vtbl; }; -DEFINE_MANAGED_VTABLE(GC); +DEFINE_OBJECT_VTABLE(GC); } // builtins |