aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4regexpobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-08-10 15:41:59 +0200
committerLars Knoll <lars.knoll@qt.io>2018-08-23 08:13:00 +0000
commit271e0d56bce54c0a662fe0e948f28a1886b14a55 (patch)
tree2d6507de5f83d1c8952be3e660b311b1c45e5427 /src/qml/jsruntime/qv4regexpobject.cpp
parent8ee5dff21c3701a5a0dd1de9bed563da0aa12ef6 (diff)
Fix bugs in ArrayBuffer.prototype.slice
Change-Id: I6de8031a04c372a5309a878811da55b93b53da3d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index dd33a9fc41..dd16110c28 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -765,26 +765,6 @@ ReturnedValue RegExpPrototype::method_get_source(const FunctionObject *f, const
return scope.engine->newString(re->toString())->asReturnedValue();
}
-static const FunctionObject *speciesConstructor(Scope &scope, const Object *o, const FunctionObject *defaultConstructor)
-{
- ScopedValue C(scope, o->get(scope.engine->id_constructor()));
- if (C->isUndefined())
- return defaultConstructor;
- const Object *c = C->objectValue();
- if (!c) {
- scope.engine->throwTypeError();
- return nullptr;
- }
- ScopedValue S(scope, c->get(scope.engine->symbol_species()));
- if (S->isNullOrUndefined())
- return defaultConstructor;
- if (!S->isFunctionObject()) {
- scope.engine->throwTypeError();
- return nullptr;
- }
- return static_cast<const FunctionObject *>(S.ptr);
-}
-
ReturnedValue RegExpPrototype::method_split(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc)
{
Scope scope(f);
@@ -805,7 +785,7 @@ ReturnedValue RegExpPrototype::method_split(const FunctionObject *f, const Value
flags = scope.engine->newString(flagsString + QLatin1Char('y'));
bool unicodeMatching = flagsString.contains(QLatin1Char('u'));
- const FunctionObject *C = speciesConstructor(scope, rx, scope.engine->regExpCtor());
+ const FunctionObject *C = rx->speciesConstructor(scope, scope.engine->regExpCtor());
if (!C)
return Encode::undefined();