From a1964f0b8e0569ef9ab754e2ec4c4d0559bc7681 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 8 Aug 2018 13:15:40 +0200 Subject: Cleanup RegExpObject Move properties from RegExpObject to getters in RegExp.prototype to be compliant with the JS spec. Implement support for the sticky flags ('y') and correctly parse the flags in the RegExp constructor. Change-Id: I5cf05d14e8139cf30d46235b8d466fb96084fcb7 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compileddata.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/qml/compiler/qv4compileddata.cpp') diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 798bfe921e..46034050e0 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -149,19 +149,9 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine) memset(runtimeRegularExpressions, 0, data->regexpTableSize * sizeof(QV4::Value)); for (uint i = 0; i < data->regexpTableSize; ++i) { const CompiledData::RegExp *re = data->regexpAt(i); - bool global = false; - bool multiline = false; - bool ignoreCase = false; - bool unicode = false; - if (re->flags & CompiledData::RegExp::RegExp_Global) - global = true; - if (re->flags & CompiledData::RegExp::RegExp_IgnoreCase) - ignoreCase = true; - if (re->flags & CompiledData::RegExp::RegExp_Multiline) - multiline = true; - if (re->flags & CompiledData::RegExp::RegExp_Unicode) - unicode = true; - runtimeRegularExpressions[i] = QV4::RegExp::create(engine, stringAt(re->stringIndex), ignoreCase, multiline, global, unicode); + uint f = re->flags; + const CompiledData::RegExp::Flags flags = static_cast(f); + runtimeRegularExpressions[i] = QV4::RegExp::create(engine, stringAt(re->stringIndex), flags); } if (data->lookupTableSize) { -- cgit v1.2.3