aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4regexpobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index efe3c1fe71..697d5e35d6 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -143,6 +143,8 @@ void RegExpObject::init(ExecutionEngine *engine)
type = Type_RegExpObject;
Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
ScopedString lastIndex(scope, engine->newIdentifier(QStringLiteral("lastIndex")));
Property *lastIndexProperty = insertMember(lastIndex, Attr_NotEnumerable|Attr_NotConfigurable);
lastIndexProperty->value = Value::fromInt32(0);
@@ -228,7 +230,7 @@ uint RegExpObject::flags() const
DEFINE_MANAGED_VTABLE(RegExpCtor);
RegExpCtor::RegExpCtor(ExecutionContext *scope)
- : FunctionObject(scope, scope->engine->newIdentifier(QStringLiteral("RegExp")))
+ : FunctionObject(scope, QStringLiteral("RegExp"))
{
vtbl = &static_vtbl;
}