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

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

Issue 3410011: Fix a regression in character-at stub when doing a keyed load on a string. ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 3 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/x64/ic-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-900966.js
===================================================================
--- test/mjsunit/regress/regress-900966.js (revision 5468)
+++ test/mjsunit/regress/regress-900966.js (working copy)
@@ -29,6 +29,15 @@
String.prototype[10] = 'x';
assertEquals('abc'[10], 'x');
+// Test that the fast case character-at stub handles an out-of-bound
+// index correctly. We need to call the function twice to initialize
+// the character-at stub.
+function f() {
+ assertEquals('abc'[10], 'x');
+}
+f();
Kasper Lund 2010/09/16 09:17:05 Add a comment about why you need two calls here.
+f();
+
assertTrue(2[11] === undefined);
Number.prototype[11] = 'y';
assertEquals(2[11], 'y');
« no previous file with comments | « src/x64/ic-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698