diff options
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4regexpobject.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index 8bcddcce0a..4f0f07377f 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -258,6 +258,8 @@ ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData) QString pattern; if (!r->isUndefined()) pattern = r->toString(ctx)->toQString(); + if (scope.hasException()) + return Encode::undefined(); bool global = false; bool ignoreCase = false; @@ -265,6 +267,8 @@ ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData) if (!f->isUndefined()) { f = __qmljs_to_string(f, ctx); QString str = f->stringValue()->toQString(); + if (scope.hasException()) + return Encode::undefined(); for (int i = 0; i < str.length(); ++i) { if (str.at(i) == QChar('g') && !global) { global = true; |