aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsapi/qjsvalue.cpp6
-rw-r--r--src/qml/jsruntime/qv4arraybuffer.cpp6
-rw-r--r--src/qml/jsruntime/qv4jscall_p.h4
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp6
-rw-r--r--src/qml/jsruntime/qv4typedarray.cpp10
6 files changed, 17 insertions, 21 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index 0bd7b0a62b..ab50301cd9 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -762,16 +762,16 @@ QJSValue QJSValue::callAsConstructor(const QJSValueList &args)
Q_ASSERT(engine);
Scope scope(engine);
- JSCallData jsCall(scope, f, args.size());
+ JSCallData jsCallData(scope, f, args.size());
for (int i = 0; i < args.size(); ++i) {
if (!QJSValuePrivate::checkEngine(engine, args.at(i))) {
qWarning("QJSValue::callAsConstructor() failed: cannot construct function with argument created in a different engine");
return QJSValue();
}
- jsCall->args[i] = QJSValuePrivate::convertedToValue(engine, args.at(i));
+ jsCallData->args[i] = QJSValuePrivate::convertedToValue(engine, args.at(i));
}
- ScopedValue result(scope, jsCall.callAsConstructor());
+ ScopedValue result(scope, f->callAsConstructor(jsCallData));
if (engine->hasException)
result = engine->catchException();
diff --git a/src/qml/jsruntime/qv4arraybuffer.cpp b/src/qml/jsruntime/qv4arraybuffer.cpp
index ffa19b8964..3bbec7957a 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();
- JSCallData jsCall(scope, constructor, 1);
+ JSCallData jsCallData(scope, constructor, 1);
double newLen = qMax(final - first, 0.);
- jsCall->args[0] = QV4::Encode(newLen);
- QV4::Scoped<ArrayBuffer> newBuffer(scope, jsCall.callAsConstructor());
+ jsCallData->args[0] = QV4::Encode(newLen);
+ QV4::Scoped<ArrayBuffer> newBuffer(scope, constructor->callAsConstructor(jsCallData));
if (!newBuffer || newBuffer->d()->data->size < (int)newLen)
return v4->throwTypeError();
diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h
index 291e108853..a71d14ad6c 100644
--- a/src/qml/jsruntime/qv4jscall_p.h
+++ b/src/qml/jsruntime/qv4jscall_p.h
@@ -118,10 +118,6 @@ struct JSCallData {
return static_cast<FunctionObject &>(ptr->function).call(*this);
}
- ReturnedValue callAsConstructor() const {
- return static_cast<FunctionObject &>(ptr->function).callAsConstructor(*this);
- }
-
CallData *ptr;
};
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index ae2ee7e3eb..556a2a5339 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -436,10 +436,10 @@ ReturnedValue RegExpPrototype::method_compile(const BuiltinFunction *b, CallData
if (!r)
return scope.engine->throwTypeError();
- JSCallData jsCall(scope, scope.engine->regExpCtor(), callData->argc());
- memcpy(jsCall->args, callData->args, callData->argc()*sizeof(Value));
+ JSCallData jsCallData(scope, scope.engine->regExpCtor(), callData->argc());
+ memcpy(jsCallData->args, callData->args, callData->argc()*sizeof(Value));
- Scoped<RegExpObject> re(scope, jsCall.callAsConstructor());
+ Scoped<RegExpObject> re(scope, scope.engine->regExpCtor()->callAsConstructor(jsCallData));
r->d()->value.set(scope.engine, re->value());
return Encode::undefined();
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 0168e09763..b7aefd3742 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -644,9 +644,9 @@ ReturnedValue StringPrototype::method_search(const BuiltinFunction *b, CallData
RegExpObject *regExp = regExpObj->as<RegExpObject>();
if (!regExp) {
- JSCallData jsCall(scope, scope.engine->regExpCtor(), 1);
- jsCall->args[0] = regExpObj;
- regExpObj = jsCall.callAsConstructor();
+ JSCallData jsCallData(scope, scope.engine->regExpCtor(), 1);
+ jsCallData->args[0] = regExpObj;
+ regExpObj = scope.engine->regExpCtor()->callAsConstructor(jsCallData);
if (scope.engine->hasException)
return QV4::Encode::undefined();
diff --git a/src/qml/jsruntime/qv4typedarray.cpp b/src/qml/jsruntime/qv4typedarray.cpp
index 3f147acf4b..8583d5da06 100644
--- a/src/qml/jsruntime/qv4typedarray.cpp
+++ b/src/qml/jsruntime/qv4typedarray.cpp
@@ -572,9 +572,9 @@ ReturnedValue TypedArrayPrototype::method_subarray(const BuiltinFunction *builti
if (!constructor)
return scope.engine->throwTypeError();
- JSCallData jsCall(scope, constructor, 3);
- jsCall->args[0] = buffer;
- jsCall->args[1] = Encode(a->d()->byteOffset + begin*a->d()->type->bytesPerElement);
- jsCall->args[2] = Encode(newLen);
- return jsCall.callAsConstructor();
+ JSCallData jsCallData(scope, constructor, 3);
+ jsCallData->args[0] = buffer;
+ jsCallData->args[1] = Encode(a->d()->byteOffset + begin*a->d()->type->bytesPerElement);
+ jsCallData->args[2] = Encode(newLen);
+ return constructor->callAsConstructor(jsCallData);
}