mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Backout Bug 829758 to investigate crashes.
This commit is contained in:
parent
dbac2df8fb
commit
317b86649c
@ -1900,17 +1900,19 @@ js::str_search(JSContext *cx, unsigned argc, Value *vp)
|
||||
|
||||
/* Per ECMAv5 15.5.4.12 (5) The last index property is ignored and left unchanged. */
|
||||
size_t i = 0;
|
||||
MatchPair match;
|
||||
ScopedMatchPairs matches(&cx->tempLifoAlloc());
|
||||
|
||||
RegExpRunStatus status = g.regExp().executeMatchOnly(cx, chars, length, &i, match);
|
||||
RegExpRunStatus status = g.regExp().execute(cx, chars, length, &i, matches);
|
||||
if (status == RegExpRunStatus_Error)
|
||||
return false;
|
||||
|
||||
if (status == RegExpRunStatus_Success)
|
||||
res->updateLazily(cx, stableStr, &g.regExp(), 0);
|
||||
if (status == RegExpRunStatus_Success) {
|
||||
res->updateFromMatchPairs(cx, stableStr, matches);
|
||||
args.rval().setInt32(matches[0].start);
|
||||
} else {
|
||||
args.rval().setInt32(-1);
|
||||
}
|
||||
|
||||
JS_ASSERT_IF(status == RegExpRunStatus_Success_NotFound, match.start == -1);
|
||||
args.rval().setInt32(match.start);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user