aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-20 18:57:07 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-09-20 18:57:07 +0000
commit112d668c0fded8c6ab7bf40fd3800cf43e005f95 (patch)
treeb23889851a0d8c779bd7f2f3605375f8adc1cb05 /src/qml/jsruntime/qv4runtime.cpp
parentae805cafde1f327c9252b9d08449a08f052746d4 (diff)
parent55a671ea73fbe657f360befa221e2c0c15ed4b0e (diff)
Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 9737a18812..4b952bcbbc 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -51,6 +51,8 @@
#include "qv4lookup_p.h"
#include "qv4function_p.h"
#include "qv4numberobject_p.h"
+#include "qv4regexp_p.h"
+#include "qv4regexpobject_p.h"
#include "private/qlocale_tools_p.h"
#include "qv4scopedvalue_p.h"
#include <private/qv4qmlcontext_p.h>
@@ -1477,7 +1479,10 @@ ReturnedValue Runtime::method_getQmlContext(NoThrowEngine *engine)
ReturnedValue Runtime::method_regexpLiteral(ExecutionEngine *engine, int id)
{
- return static_cast<CompiledData::CompilationUnit*>(engine->current->compilationUnit)->runtimeRegularExpressions[id].asReturnedValue();
+ Heap::RegExpObject *ro = engine->newRegExpObject(
+ static_cast<CompiledData::CompilationUnit*>(engine->current->compilationUnit)
+ ->runtimeRegularExpressions[id].as<RegExp>());
+ return ro->asReturnedValue();
}
ReturnedValue Runtime::method_getQmlQObjectProperty(ExecutionEngine *engine, const Value &object, int propertyIndex, bool captureRequired)