From 4e1512baf6d1220c9e89c8a36f16de400bb1b519 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 5 Dec 2017 10:45:14 +0100 Subject: Convert more builtin functions to use the new calling convention Convert most of the methods used QML objects to the new calling convention. Converted IndexedBuiltinFunction to do the same. Change-Id: I41b26042c2f56f24988485b06e8ccd214e2573c0 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4jsonobject.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/qml/jsruntime/qv4jsonobject.cpp') diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 5e580b8b4d..51802d895b 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -884,12 +884,12 @@ void Heap::JsonObject::init() } -ReturnedValue JsonObject::method_parse(const BuiltinFunction *b, CallData *callData) +ReturnedValue JsonObject::method_parse(const FunctionObject *b, const Value *, const Value *argv, int argc) { ExecutionEngine *v4 = b->engine(); QString jtext; - if (callData->argc() > 0) - jtext = callData->args[0].toQString(); + if (argc > 0) + jtext = argv[0].toQString(); DEBUG << "parsing source = " << jtext; JsonParser parser(v4, jtext.constData(), jtext.length()); @@ -903,12 +903,12 @@ ReturnedValue JsonObject::method_parse(const BuiltinFunction *b, CallData *callD return result; } -ReturnedValue JsonObject::method_stringify(const BuiltinFunction *b, CallData *callData) +ReturnedValue JsonObject::method_stringify(const FunctionObject *b, const Value *, const Value *argv, int argc) { Scope scope(b); Stringify stringify(scope.engine); - ScopedObject o(scope, callData->argument(1)); + ScopedObject o(scope, argc > 1 ? argv[1] : Primitive::undefinedValue()); if (o) { stringify.replacerFunction = o->as(); if (o->isArrayObject()) { @@ -933,7 +933,7 @@ ReturnedValue JsonObject::method_stringify(const BuiltinFunction *b, CallData *c } } - ScopedValue s(scope, callData->argument(2)); + ScopedValue s(scope, argc > 2 ? argv[2] : Primitive::undefinedValue()); if (NumberObject *n = s->as()) s = Encode(n->value()); else if (StringObject *so = s->as()) @@ -946,7 +946,7 @@ ReturnedValue JsonObject::method_stringify(const BuiltinFunction *b, CallData *c } - ScopedValue arg0(scope, callData->argument(0)); + ScopedValue arg0(scope, argc ? argv[0] : Primitive::undefinedValue()); QString result = stringify.Str(QString(), arg0); if (result.isEmpty() || scope.engine->hasException) RETURN_UNDEFINED(); -- cgit v1.2.3