diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-01-18 14:15:59 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-20 23:35:18 +0100 |
commit | 1d577f68883bdc41be18d2a09a5bdf0a0611c380 (patch) | |
tree | 5830fc2a3ef9e9375ed3899a7574b02e4db293e5 /src/declarative/qml/v8/qjsvalue_impl_p.h | |
parent | 174ee897edbea436046cfe0ea02f4185e1e0de34 (diff) |
Add QJSValue::callAsConstructor() function
The old name, construct(), was bad. This name is more descriptive
and consistent with the other callXXX() functions.
Task-number: QTBUG-23604
Change-Id: Ie205b0c52721782101e665f7dfedcac9051a00d0
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qjsvalue_impl_p.h')
-rw-r--r-- | src/declarative/qml/v8/qjsvalue_impl_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/qml/v8/qjsvalue_impl_p.h b/src/declarative/qml/v8/qjsvalue_impl_p.h index 6e1cc4bbaf..9fad4c2be3 100644 --- a/src/declarative/qml/v8/qjsvalue_impl_p.h +++ b/src/declarative/qml/v8/qjsvalue_impl_p.h @@ -974,7 +974,7 @@ QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::call(QJSValuePrivate* thisO return new QJSValuePrivate(e, result); } -inline QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::construct(int argc, v8::Handle<v8::Value> *argv) +inline QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::callAsConstructor(int argc, v8::Handle<v8::Value> *argv) { QV8Engine *e = engine(); @@ -995,7 +995,7 @@ inline QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::construct(int argc, return new QJSValuePrivate(e, result); } -inline QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::construct(const QJSValueList& args) +inline QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::callAsConstructor(const QJSValueList& args) { if (!isCallable()) return InvalidValue(); @@ -1006,11 +1006,11 @@ inline QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::construct(const QJSV int argc = args.size(); QVarLengthArray<v8::Handle<v8::Value>, 8> argv(argc); if (!prepareArgumentsForCall(argv.data(), args)) { - qWarning("QJSValue::construct() failed: cannot construct function with argument created in a different engine"); + qWarning("QJSValue::callAsConstructor() failed: cannot construct function with argument created in a different engine"); return InvalidValue(); } - return construct(argc, argv.data()); + return callAsConstructor(argc, argv.data()); } /*! \internal |