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

Unified Diff: test/mjsunit/string-indexof-1.js

Issue 2679173002: [builtins] fix String.prototype.indexOf with negative indices (Closed)
Patch Set: fix accidental change 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 | « src/builtins/builtins-string.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/string-indexof-1.js
diff --git a/test/mjsunit/string-indexof-1.js b/test/mjsunit/string-indexof-1.js
index 61473255fbfa88173a584a0a7e3fcfa18e41cb21..d83c784fd13ca1d12b75536cc9f755c046eed74b 100644
--- a/test/mjsunit/string-indexof-1.js
+++ b/test/mjsunit/string-indexof-1.js
@@ -244,6 +244,24 @@ for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
assertEquals(3, f4());
% OptimizeFunctionOnNextCall(f4);
assertEquals(3, f4());
+
+ function f5() {
+ return 'abcbc'.indexOf('b', -1);
+ }
+ assertEquals(1, f5());
+ assertEquals(1, f5());
+ assertEquals(1, f5());
+ % OptimizeFunctionOnNextCall(f5);
+ assertEquals(1, f5());
+
+ function f6() {
+ return 'abcbc'.indexOf('b', -10737418);
+ }
+ assertEquals(1, f6());
+ assertEquals(1, f6());
+ assertEquals(1, f6());
+ % OptimizeFunctionOnNextCall(f6);
+ assertEquals(1, f6());
})();
(function optimizeOSR() {
« no previous file with comments | « src/builtins/builtins-string.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698