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

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

Issue 23619036: Reland "Clean up after r16292 (disable optimization for StringWrappers)." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix bug Created 7 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/full-codegen-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-2855.js
diff --git a/test/mjsunit/regress/regress-2855.js b/test/mjsunit/regress/regress-2855.js
index ac721af73bf4c91ecc751fc31a3db91cf6942c93..24ec452d5994505c2db68476a0a946155f731bae 100644
--- a/test/mjsunit/regress/regress-2855.js
+++ b/test/mjsunit/regress/regress-2855.js
@@ -39,3 +39,19 @@ for (var i = 0; i < 4; ++i) {
}
assertEquals(expected, "" + foo("hello"));
}
+
+// Make sure we look up "valueOf" only once.
+var count = 0;
+var x = new String("foo");
+Object.defineProperty(x, "valueOf",
+ { get: function() {
+ count++;
+ return function() {
+ return 11;
+ }
+ }
+ });
+for (var i = 0; i < 3; i++) {
+ assertEquals("11", "" + x);
+ assertEquals(i + 1, count);
+}
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698