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

Unified Diff: test/mjsunit/regress/regress-seqstrsetchar-ex3.js

Issue 15849003: Add belated test for the SeqStringSetChar bug. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-seqstrsetchar-ex3.js
diff --git a/test/mjsunit/elide-double-hole-check-7.js b/test/mjsunit/regress/regress-seqstrsetchar-ex3.js
similarity index 84%
copy from test/mjsunit/elide-double-hole-check-7.js
copy to test/mjsunit/regress/regress-seqstrsetchar-ex3.js
index 2b13aff881589d79051a23819415be3fa22eee30..e2592a1615aa6bcfbbaa688319b8a0f6d34aa4a7 100644
--- a/test/mjsunit/elide-double-hole-check-7.js
+++ b/test/mjsunit/regress/regress-seqstrsetchar-ex3.js
@@ -27,14 +27,19 @@
// Flags: --allow-natives-syntax
-function f1(a, i) {
- return a[i] + 0.5;
+function test() {
+ var string = %NewString(10, true);
+ for (var i = 0; i < 10; i++) {
+ %_OneByteSeqStringSetChar(string, i, 65);
+ %_OneByteSeqStringSetChar(string, i, 66);
+ }
+ for (var i = 0; i < 10; i++) {
+ assertEquals("B", string[i]);
+ }
}
-var arr = [0.0,,2.5];
-assertEquals(0.5, f1(arr, 0));
-assertEquals(0.5, f1(arr, 0));
-Array.prototype.__proto__[1] = 1.5;
-assertEquals(2, f1(arr, 1));
-%OptimizeFunctionOnNextCall(f1);
-assertEquals(2, f1(arr, 1));
-assertEquals(0.5, f1(arr, 0));
+
+test();
+test();
+%OptimizeFunctionOnNextCall(test);
+test();
+
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698