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

Unified Diff: test/mjsunit/regress/regress-2438.js

Issue 2681323002: [regexp] Update lastIndex semantics in RegExpBuiltinExec (Closed)
Patch Set: Update test262.status Created 3 years, 10 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 | « test/mjsunit/regexp.js ('k') | test/test262/test262.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-2438.js
diff --git a/test/mjsunit/regress/regress-2438.js b/test/mjsunit/regress/regress-2438.js
index 51092788ac6f7fb8824f4df1e44f37f45cffd650..b9d8875cb597e6e47dc8214b316f633c18a530e3 100644
--- a/test/mjsunit/regress/regress-2438.js
+++ b/test/mjsunit/regress/regress-2438.js
@@ -27,20 +27,16 @@
function testSideEffects(subject, re) {
var counter = 0;
- var expected_counter = 0;
- const accesses_lastindex = (re.global || re.sticky);
var side_effect_object = { valueOf: function() { return counter++; } };
re.lastIndex = side_effect_object;
re.exec(subject);
- if (accesses_lastindex) expected_counter++;
- assertEquals(expected_counter, counter);
+ assertEquals(1, counter);
re.lastIndex = side_effect_object;
re.test(subject);
- if (accesses_lastindex) expected_counter++;
- assertEquals(expected_counter, counter);
+ assertEquals(2, counter);
}
testSideEffects("zzzz", /a/);
« no previous file with comments | « test/mjsunit/regexp.js ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698