diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-05-09 12:15:23 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:49:18 +0200 |
commit | dba56a752c932670c0e9461f106d2bc084276b6f (patch) | |
tree | 3a669663fa85dd3d61a83c29e8961b70ac53f046 /tools/qmljs | |
parent | 00fa9049112385f65ccdcad02b8712a32626d20c (diff) |
Convert remaining FunctionObject's to new constructor scheme
Change-Id: I440d5b128d0ee28566ebfa82c2505a4bd97bba6b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tools/qmljs')
-rw-r--r-- | tools/qmljs/main.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/tools/qmljs/main.cpp b/tools/qmljs/main.cpp index f3642cd213..3fe3a0de8f 100644 --- a/tools/qmljs/main.cpp +++ b/tools/qmljs/main.cpp @@ -72,10 +72,13 @@ using namespace QV4; struct Print: FunctionObject { + struct Data : FunctionObject::Data { + Data(ExecutionContext *scope) + : FunctionObject::Data(scope, QStringLiteral("print")) { + setVTable(staticVTable()); + } + }; V4_OBJECT - Print(ExecutionContext *scope): FunctionObject(scope, QStringLiteral("print")) { - setVTable(staticVTable()); - } static ReturnedValue call(Managed *, CallData *callData) { @@ -94,12 +97,16 @@ DEFINE_OBJECT_VTABLE(Print); struct GC: public FunctionObject { + struct Data : FunctionObject::Data { + Data(ExecutionContext *scope) + : FunctionObject::Data(scope, QStringLiteral("gc")) + { + setVTable(staticVTable()); + } + + }; V4_OBJECT - GC(ExecutionContext* scope) - : FunctionObject(scope, QStringLiteral("gc")) - { - setVTable(staticVTable()); - } + static ReturnedValue call(Managed *m, CallData *) { m->engine()->memoryManager->runGC(); @@ -190,9 +197,9 @@ int main(int argc, char *argv[]) QV4::Scope scope(ctx); QV4::ScopedObject globalObject(scope, vm.globalObject); - QV4::ScopedObject print(scope, new (scope.engine->memoryManager) builtins::Print(ctx)); + QV4::ScopedObject print(scope, new (scope.engine) builtins::Print::Data(ctx)); globalObject->put(QV4::ScopedString(scope, vm.newIdentifier(QStringLiteral("print"))).getPointer(), print); - QV4::ScopedObject gc(scope, new (scope.engine->memoryManager) builtins::GC(ctx)); + QV4::ScopedObject gc(scope, new (scope.engine) builtins::GC::Data(ctx)); globalObject->put(QV4::ScopedString(scope, vm.newIdentifier(QStringLiteral("gc"))).getPointer(), gc); foreach (const QString &fn, args) { |