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

Unified Diff: test/mjsunit/smi-negative-zero.js

Issue 3748007: Do not return the constant singleton float -0.0 from UnaryOpStub, because it ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 2 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/code-stubs-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/smi-negative-zero.js
===================================================================
--- test/mjsunit/smi-negative-zero.js (revision 5628)
+++ test/mjsunit/smi-negative-zero.js (working copy)
@@ -98,3 +98,16 @@
assertEquals(-Infinity, one / (-4 % -2), "fiskhest2");
assertEquals(Infinity, one / (4 % 2), "fiskhest3");
assertEquals(Infinity, one / (4 % -2), "fiskhest4");
+
+
+// This tests against a singleton -0.0 object being overwritten.
+x = 0;
+z = 3044;
+
+function foo(x) {
+ var y = -x + z;
+ return -x;
+}
+
+assertEquals(0, foo(x));
+assertEquals(0, foo(x));
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698