From 74c8fe86755af485f8d0a47799d6d50f00070f05 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 1 Sep 2017 11:48:15 +0200 Subject: Always set the correct FunctionObject when calling JS functions Renamed ScopedCallData to JSCall, enforced passing a JS FunctionObject to it, and added call() and callAsConstructor() methods to it. Change-Id: I30db65c9765c2896b5909fe2105c0934c6dad861 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4arraybuffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/jsruntime/qv4arraybuffer.cpp') diff --git a/src/qml/jsruntime/qv4arraybuffer.cpp b/src/qml/jsruntime/qv4arraybuffer.cpp index 33ef7fa6df..bd47d0bc77 100644 --- a/src/qml/jsruntime/qv4arraybuffer.cpp +++ b/src/qml/jsruntime/qv4arraybuffer.cpp @@ -187,10 +187,10 @@ ReturnedValue ArrayBufferPrototype::method_slice(const BuiltinFunction *b, CallD if (!constructor) return v4->throwTypeError(); - ScopedCallData cData(scope, 1); + JSCall jsCall(scope, constructor, 1); double newLen = qMax(final - first, 0.); - cData->args[0] = QV4::Encode(newLen); - QV4::Scoped newBuffer(scope, constructor->construct(cData)); + jsCall->args[0] = QV4::Encode(newLen); + QV4::Scoped newBuffer(scope, jsCall.callAsConstructor()); if (!newBuffer || newBuffer->d()->data->size < (int)newLen) return v4->throwTypeError(); -- cgit v1.2.3