mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Minor Fix in RegexpObject Match
Signed-off-by: bence gabor kis <kisbg@inf.u-szeged.hu>
This commit is contained in:
parent
3f6c034b51
commit
81a0e9e1ca
3 changed files with 3 additions and 6 deletions
|
|
@ -337,6 +337,7 @@ bool RegExpObject::match(ExecutionState& state, String* str, RegexMatchResult& m
|
|||
size_t start = startIndex;
|
||||
unsigned result = 0;
|
||||
bool isGlobal = option() & RegExpObject::Option::Global;
|
||||
bool isSticky = option() & RegExpObject::Option::Sticky;
|
||||
bool gotResult = false;
|
||||
bool reachToEnd = false;
|
||||
unsigned* outputBuf = ALLOCA(sizeof(unsigned) * 2 * (subPatternNum + 1), unsigned int, state);
|
||||
|
|
@ -378,7 +379,7 @@ bool RegExpObject::match(ExecutionState& state, String* str, RegexMatchResult& m
|
|||
|
||||
if (UNLIKELY(testOnly)) {
|
||||
// outputBuf[1] should be set to lastIndex
|
||||
if (isGlobal) {
|
||||
if (isGlobal || isSticky) {
|
||||
setLastIndex(state, Value(outputBuf[1]));
|
||||
}
|
||||
if (!lastParenInvalid && subPatternNum) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue