aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4sequenceobject.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-08-27 11:44:19 +0200
committerUlf Hermann <ulf.hermann@qt.io>2025-09-01 19:25:20 +0200
commit1f2c87f754eb5fcedd92ab522243b4d3d953393e (patch)
treefdac71cfc2cf6dc64da42bd2e09c0f9ad2b8899a /src/qml/jsruntime/qv4sequenceobject.cpp
parentdec8d8d6ab824538c6c119949dadfb369f9d311a (diff)
QtQml: Move Sequence's length accessors into SequencePrototype
We will need to befriend them. Pick-to: 6.10 6.9 6.8 Task-number: QTBUG-129972 Task-number: QTBUG-139025 Change-Id: I0d877627f2b838f2bf06a7049cd51927e13bd24d Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4sequenceobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4sequenceobject.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp
index ae4d83def4..82fc84d361 100644
--- a/src/qml/jsruntime/qv4sequenceobject.cpp
+++ b/src/qml/jsruntime/qv4sequenceobject.cpp
@@ -490,7 +490,8 @@ int Sequence::virtualMetacall(Object *object, QMetaObject::Call call, int index,
return -1;
}
-static QV4::ReturnedValue method_get_length(const FunctionObject *b, const Value *thisObject, const Value *, int)
+QV4::ReturnedValue SequencePrototype::method_getLength(
+ const FunctionObject *b, const Value *thisObject, const Value *, int)
{
QV4::Scope scope(b);
QV4::Scoped<Sequence> This(scope, thisObject->as<Sequence>());
@@ -507,7 +508,8 @@ static QV4::ReturnedValue method_get_length(const FunctionObject *b, const Value
return scope.engine->throwRangeError(QLatin1String("Sequence length out of range"));
}
-static QV4::ReturnedValue method_set_length(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
+QV4::ReturnedValue SequencePrototype::method_setLength(
+ const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
{
QV4::Scope scope(f);
QV4::Scoped<Sequence> This(scope, thisObject->as<Sequence>());
@@ -557,7 +559,7 @@ static QV4::ReturnedValue method_set_length(const FunctionObject *f, const Value
void SequencePrototype::init()
{
defineDefaultProperty(engine()->id_valueOf(), method_valueOf, 0);
- defineAccessorProperty(QStringLiteral("length"), method_get_length, method_set_length);
+ defineAccessorProperty(QStringLiteral("length"), method_getLength, method_setLength);
defineDefaultProperty(QStringLiteral("shift"), method_shift, 0);
}