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

Unified Diff: test/mjsunit/compare-nan.js

Issue 524059: Speed up compares with characters ie single-character strings.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 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 | « test/mjsunit/compare-character.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compare-nan.js
===================================================================
--- test/mjsunit/compare-nan.js (revision 3561)
+++ test/mjsunit/compare-nan.js (working copy)
@@ -42,3 +42,25 @@
assertFalse(x <= NaN, "" + x + " <= NaN");
assertFalse(x >= NaN, "" + x + " >= NaN");
}
+
+var b = ["NaN", "-1", "0", "1", "1.2", "-7.9", "true", "false", "'foo'", "'0'",
+ "'NaN'" ];
+for (var i in b) {
+ var x = b[i];
+ var program =
+ "assertFalse(NaN == " + x + ", 'NaN == ' + " + x + ");\n" +
+ "assertFalse(NaN === " + x + ", 'NaN === ' + " + x + ");\n" +
+ "assertFalse(NaN < " + x + ", 'NaN < ' + " + x + ");\n" +
+ "assertFalse(NaN > " + x + ", 'NaN > ' + " + x + ");\n" +
+ "assertFalse(NaN <= " + x + ", 'NaN <= ' + " + x + ");\n" +
+ "assertFalse(NaN >= " + x + ", 'NaN >= ' + " + x + ");\n" +
+
+ "assertFalse(" + x + " == NaN, '' + " + x + " + ' == NaN');\n" +
+ "assertFalse(" + x + " === NaN, '' + " + x + " + ' === NaN');\n" +
+ "assertFalse(" + x + " < NaN, '' + " + x + " + ' < NaN');\n" +
+ "assertFalse(" + x + " > NaN, '' + " + x + " + ' > NaN');\n" +
+ "assertFalse(" + x + " <= NaN, '' + " + x + " + ' <= NaN');\n" +
+ "assertFalse(" + x + " >= NaN, '' + " + x + " + ' >= NaN');\n";
+ eval(program);
+}
+
« no previous file with comments | « test/mjsunit/compare-character.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698