Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: src/regexp.js

Issue 1378693004: RegExp: Fix update of lastIndex on non-global sticky (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/regexp-sticky.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp.js
diff --git a/src/regexp.js b/src/regexp.js
index 1b72926844d28c999ea2c410e2e2ab631929f7f4..90d4d358e8d2653797d0b586fa8b306f481437e5 100644
--- a/src/regexp.js
+++ b/src/regexp.js
@@ -143,6 +143,10 @@ function RegExpExecNoTests(regexp, string, start) {
var matchInfo = %_RegExpExec(regexp, string, start, RegExpLastMatchInfo);
if (matchInfo !== null) {
$regexpLastMatchInfoOverride = null;
+ // ES6 21.2.5.2.2 step 18.
+ if (FLAG_harmony_regexps && regexp.sticky) {
+ regexp.lastIndex = matchInfo[CAPTURE1];
+ }
RETURN_NEW_RESULT_FROM_MATCH_INFO(matchInfo, string);
}
regexp.lastIndex = 0;
« no previous file with comments | « no previous file | test/mjsunit/harmony/regexp-sticky.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698