Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | function testComparisons() |
michael@0 | 2 | { |
michael@0 | 3 | // All the special values from each of the types in |
michael@0 | 4 | // ECMA-262, 3rd ed. section 8 |
michael@0 | 5 | var undefinedType, nullType, booleanType, stringType, numberType, objectType; |
michael@0 | 6 | |
michael@0 | 7 | var types = []; |
michael@0 | 8 | types[undefinedType = 0] = "Undefined"; |
michael@0 | 9 | types[nullType = 1] = "Null"; |
michael@0 | 10 | types[booleanType = 2] = "Boolean"; |
michael@0 | 11 | types[stringType = 3] = "String"; |
michael@0 | 12 | types[numberType = 4] = "Number"; |
michael@0 | 13 | types[objectType = 5] = "Object"; |
michael@0 | 14 | |
michael@0 | 15 | var JSVAL_INT_MIN = -Math.pow(2, 30); |
michael@0 | 16 | var JSVAL_INT_MAX = Math.pow(2, 30) - 1; |
michael@0 | 17 | |
michael@0 | 18 | // Values from every ES3 type, hitting all the edge-case and special values |
michael@0 | 19 | // that can be dreamed up |
michael@0 | 20 | var values = |
michael@0 | 21 | { |
michael@0 | 22 | "undefined": |
michael@0 | 23 | { |
michael@0 | 24 | value: function() { return undefined; }, |
michael@0 | 25 | type: undefinedType |
michael@0 | 26 | }, |
michael@0 | 27 | "null": |
michael@0 | 28 | { |
michael@0 | 29 | value: function() { return null; }, |
michael@0 | 30 | type: nullType |
michael@0 | 31 | }, |
michael@0 | 32 | "true": |
michael@0 | 33 | { |
michael@0 | 34 | value: function() { return true; }, |
michael@0 | 35 | type: booleanType |
michael@0 | 36 | }, |
michael@0 | 37 | "false": |
michael@0 | 38 | { |
michael@0 | 39 | value: function() { return false; }, |
michael@0 | 40 | type: booleanType |
michael@0 | 41 | }, |
michael@0 | 42 | '""': |
michael@0 | 43 | { |
michael@0 | 44 | value: function() { return ""; }, |
michael@0 | 45 | type: stringType |
michael@0 | 46 | }, |
michael@0 | 47 | '"a"': |
michael@0 | 48 | { |
michael@0 | 49 | // a > [, for string-object comparisons |
michael@0 | 50 | value: function() { return "a"; }, |
michael@0 | 51 | type: stringType |
michael@0 | 52 | }, |
michael@0 | 53 | '"Z"': |
michael@0 | 54 | { |
michael@0 | 55 | // Z < [, for string-object comparisons |
michael@0 | 56 | value: function() { return "Z"; }, |
michael@0 | 57 | type: stringType |
michael@0 | 58 | }, |
michael@0 | 59 | "0": |
michael@0 | 60 | { |
michael@0 | 61 | value: function() { return 0; }, |
michael@0 | 62 | type: numberType |
michael@0 | 63 | }, |
michael@0 | 64 | "-0": |
michael@0 | 65 | { |
michael@0 | 66 | value: function() { return -0; }, |
michael@0 | 67 | type: numberType |
michael@0 | 68 | }, |
michael@0 | 69 | "1": |
michael@0 | 70 | { |
michael@0 | 71 | value: function() { return 1; }, |
michael@0 | 72 | type: numberType |
michael@0 | 73 | }, |
michael@0 | 74 | "Math.E": |
michael@0 | 75 | { |
michael@0 | 76 | value: function() { return Math.E; }, |
michael@0 | 77 | type: numberType |
michael@0 | 78 | }, |
michael@0 | 79 | "JSVAL_INT_MIN - 1": |
michael@0 | 80 | { |
michael@0 | 81 | value: function() { return JSVAL_INT_MIN - 1; }, |
michael@0 | 82 | type: numberType |
michael@0 | 83 | }, |
michael@0 | 84 | "JSVAL_INT_MIN": |
michael@0 | 85 | { |
michael@0 | 86 | value: function() { return JSVAL_INT_MIN; }, |
michael@0 | 87 | type: numberType |
michael@0 | 88 | }, |
michael@0 | 89 | "JSVAL_INT_MIN + 1": |
michael@0 | 90 | { |
michael@0 | 91 | value: function() { return JSVAL_INT_MIN + 1; }, |
michael@0 | 92 | type: numberType |
michael@0 | 93 | }, |
michael@0 | 94 | "JSVAL_INT_MAX - 1": |
michael@0 | 95 | { |
michael@0 | 96 | value: function() { return JSVAL_INT_MAX - 1; }, |
michael@0 | 97 | type: numberType |
michael@0 | 98 | }, |
michael@0 | 99 | "JSVAL_INT_MAX": |
michael@0 | 100 | { |
michael@0 | 101 | value: function() { return JSVAL_INT_MAX; }, |
michael@0 | 102 | type: numberType |
michael@0 | 103 | }, |
michael@0 | 104 | "JSVAL_INT_MAX + 1": |
michael@0 | 105 | { |
michael@0 | 106 | value: function() { return JSVAL_INT_MAX + 1; }, |
michael@0 | 107 | type: numberType |
michael@0 | 108 | }, |
michael@0 | 109 | "Infinity": |
michael@0 | 110 | { |
michael@0 | 111 | value: function() { return Infinity; }, |
michael@0 | 112 | type: numberType |
michael@0 | 113 | }, |
michael@0 | 114 | "-Infinity": |
michael@0 | 115 | { |
michael@0 | 116 | value: function() { return -Infinity; }, |
michael@0 | 117 | type: numberType |
michael@0 | 118 | }, |
michael@0 | 119 | "NaN": |
michael@0 | 120 | { |
michael@0 | 121 | value: function() { return NaN; }, |
michael@0 | 122 | type: numberType |
michael@0 | 123 | }, |
michael@0 | 124 | "{}": |
michael@0 | 125 | { |
michael@0 | 126 | value: function() { return {}; }, |
michael@0 | 127 | type: objectType |
michael@0 | 128 | }, |
michael@0 | 129 | "{ valueOf: undefined }": |
michael@0 | 130 | { |
michael@0 | 131 | value: function() { return { valueOf: undefined }; }, |
michael@0 | 132 | type: objectType |
michael@0 | 133 | }, |
michael@0 | 134 | "[]": |
michael@0 | 135 | { |
michael@0 | 136 | value: function() { return []; }, |
michael@0 | 137 | type: objectType |
michael@0 | 138 | }, |
michael@0 | 139 | '[""]': |
michael@0 | 140 | { |
michael@0 | 141 | value: function() { return [""]; }, |
michael@0 | 142 | type: objectType |
michael@0 | 143 | }, |
michael@0 | 144 | '["a"]': |
michael@0 | 145 | { |
michael@0 | 146 | value: function() { return ["a"]; }, |
michael@0 | 147 | type: objectType |
michael@0 | 148 | }, |
michael@0 | 149 | "[0]": |
michael@0 | 150 | { |
michael@0 | 151 | value: function() { return [0]; }, |
michael@0 | 152 | type: objectType |
michael@0 | 153 | } |
michael@0 | 154 | }; |
michael@0 | 155 | |
michael@0 | 156 | var orderOps = |
michael@0 | 157 | { |
michael@0 | 158 | "<": function(a, b) { return a < b; }, |
michael@0 | 159 | ">": function(a, b) { return a > b; }, |
michael@0 | 160 | "<=": function(a, b) { return a <= b; }, |
michael@0 | 161 | ">=": function(a, b) { return a >= b; } |
michael@0 | 162 | }; |
michael@0 | 163 | var eqOps = |
michael@0 | 164 | { |
michael@0 | 165 | "==": function(a, b) { return a == b; }, |
michael@0 | 166 | "!=": function(a, b) { return a != b; }, |
michael@0 | 167 | "===": function(a, b) { return a === b; }, |
michael@0 | 168 | "!==": function(a, b) { return a !== b; } |
michael@0 | 169 | }; |
michael@0 | 170 | |
michael@0 | 171 | |
michael@0 | 172 | var notEqualIncomparable = |
michael@0 | 173 | { |
michael@0 | 174 | eq: { "==": false, "!=": true, "===": false, "!==": true }, |
michael@0 | 175 | order: { "<": false, ">": false, "<=": false, ">=": false } |
michael@0 | 176 | }; |
michael@0 | 177 | var notEqualLessThan = |
michael@0 | 178 | { |
michael@0 | 179 | eq: { "==": false, "!=": true, "===": false, "!==": true }, |
michael@0 | 180 | order: { "<": true, ">": false, "<=": true, ">=": false } |
michael@0 | 181 | }; |
michael@0 | 182 | var notEqualGreaterThan = |
michael@0 | 183 | { |
michael@0 | 184 | eq: { "==": false, "!=": true, "===": false, "!==": true }, |
michael@0 | 185 | order: { "<": false, ">": true, "<=": false, ">=": true } |
michael@0 | 186 | }; |
michael@0 | 187 | var notEqualNorDifferent = |
michael@0 | 188 | { |
michael@0 | 189 | eq: { "==": false, "!=": true, "===": false, "!==": true }, |
michael@0 | 190 | order: { "<": false, ">": false, "<=": true, ">=": true } |
michael@0 | 191 | }; |
michael@0 | 192 | var strictlyEqual = |
michael@0 | 193 | { |
michael@0 | 194 | eq: { "==": true, "!=": false, "===": true, "!==": false }, |
michael@0 | 195 | order: { "<": false, ">": false, "<=": true, ">=": true } |
michael@0 | 196 | }; |
michael@0 | 197 | var looselyEqual = |
michael@0 | 198 | { |
michael@0 | 199 | eq: { "==": true, "!=": false, "===": false, "!==": true }, |
michael@0 | 200 | order: { "<": false, ">": false, "<=": true, ">=": true } |
michael@0 | 201 | }; |
michael@0 | 202 | var looselyEqualNotDifferent = |
michael@0 | 203 | { |
michael@0 | 204 | eq: { "==": true, "!=": false, "===": false, "!==": true }, |
michael@0 | 205 | order: { "<": false, ">": false, "<=": true, ">=": true } |
michael@0 | 206 | }; |
michael@0 | 207 | var looselyEqualIncomparable = |
michael@0 | 208 | { |
michael@0 | 209 | eq: { "==": true, "!=": false, "===": false, "!==": true }, |
michael@0 | 210 | order: { "<": false, ">": false, "<=": false, ">=": false } |
michael@0 | 211 | }; |
michael@0 | 212 | var strictlyEqualNotDifferent = |
michael@0 | 213 | { |
michael@0 | 214 | eq: { "==": true, "!=": false, "===": true, "!==": false }, |
michael@0 | 215 | order: { "<": false, ">": false, "<=": true, ">=": true } |
michael@0 | 216 | }; |
michael@0 | 217 | var strictlyEqualIncomparable = |
michael@0 | 218 | { |
michael@0 | 219 | eq: { "==": true, "!=": false, "===": true, "!==": false }, |
michael@0 | 220 | order: { "<": false, ">": false, "<=": false, ">=": false } |
michael@0 | 221 | }; |
michael@0 | 222 | |
michael@0 | 223 | var comparingZeroToSomething = |
michael@0 | 224 | { |
michael@0 | 225 | "undefined": notEqualIncomparable, |
michael@0 | 226 | "null": notEqualNorDifferent, |
michael@0 | 227 | "true": notEqualLessThan, |
michael@0 | 228 | "false": looselyEqual, |
michael@0 | 229 | '""': looselyEqualNotDifferent, |
michael@0 | 230 | '"a"': notEqualIncomparable, |
michael@0 | 231 | '"Z"': notEqualIncomparable, |
michael@0 | 232 | "0": strictlyEqual, |
michael@0 | 233 | "-0": strictlyEqual, |
michael@0 | 234 | "1": notEqualLessThan, |
michael@0 | 235 | "Math.E": notEqualLessThan, |
michael@0 | 236 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 237 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 238 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 239 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 240 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 241 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 242 | "Infinity": notEqualLessThan, |
michael@0 | 243 | "-Infinity": notEqualGreaterThan, |
michael@0 | 244 | "NaN": notEqualIncomparable, |
michael@0 | 245 | "{}": notEqualIncomparable, |
michael@0 | 246 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 247 | "[]": looselyEqual, |
michael@0 | 248 | '[""]': looselyEqual, |
michael@0 | 249 | '["a"]': notEqualIncomparable, |
michael@0 | 250 | "[0]": looselyEqual |
michael@0 | 251 | }; |
michael@0 | 252 | |
michael@0 | 253 | var comparingObjectOrObjectWithValueUndefined = |
michael@0 | 254 | { |
michael@0 | 255 | "undefined": notEqualIncomparable, |
michael@0 | 256 | "null": notEqualIncomparable, |
michael@0 | 257 | "true": notEqualIncomparable, |
michael@0 | 258 | "false": notEqualIncomparable, |
michael@0 | 259 | '""': notEqualGreaterThan, |
michael@0 | 260 | '"a"': notEqualLessThan, |
michael@0 | 261 | '"Z"': notEqualGreaterThan, |
michael@0 | 262 | "0": notEqualIncomparable, |
michael@0 | 263 | "-0": notEqualIncomparable, |
michael@0 | 264 | "1": notEqualIncomparable, |
michael@0 | 265 | "Math.E": notEqualIncomparable, |
michael@0 | 266 | "JSVAL_INT_MIN - 1": notEqualIncomparable, |
michael@0 | 267 | "JSVAL_INT_MIN": notEqualIncomparable, |
michael@0 | 268 | "JSVAL_INT_MIN + 1": notEqualIncomparable, |
michael@0 | 269 | "JSVAL_INT_MAX - 1": notEqualIncomparable, |
michael@0 | 270 | "JSVAL_INT_MAX": notEqualIncomparable, |
michael@0 | 271 | "JSVAL_INT_MAX + 1": notEqualIncomparable, |
michael@0 | 272 | "Infinity": notEqualIncomparable, |
michael@0 | 273 | "-Infinity": notEqualIncomparable, |
michael@0 | 274 | "NaN": notEqualIncomparable, |
michael@0 | 275 | "{}": notEqualNorDifferent, |
michael@0 | 276 | "{ valueOf: undefined }": notEqualNorDifferent, |
michael@0 | 277 | "[]": notEqualGreaterThan, |
michael@0 | 278 | '[""]': notEqualGreaterThan, |
michael@0 | 279 | '["a"]': notEqualLessThan, |
michael@0 | 280 | "[0]": notEqualGreaterThan |
michael@0 | 281 | }; |
michael@0 | 282 | |
michael@0 | 283 | // Constructed expected-value matrix |
michael@0 | 284 | var expected = |
michael@0 | 285 | { |
michael@0 | 286 | "undefined": |
michael@0 | 287 | { |
michael@0 | 288 | "undefined": strictlyEqualIncomparable, |
michael@0 | 289 | "null": looselyEqualIncomparable, |
michael@0 | 290 | "true": notEqualIncomparable, |
michael@0 | 291 | "false": notEqualIncomparable, |
michael@0 | 292 | '""': notEqualIncomparable, |
michael@0 | 293 | '"a"': notEqualIncomparable, |
michael@0 | 294 | '"Z"': notEqualIncomparable, |
michael@0 | 295 | "0": notEqualIncomparable, |
michael@0 | 296 | "-0": notEqualIncomparable, |
michael@0 | 297 | "1": notEqualIncomparable, |
michael@0 | 298 | "Math.E": notEqualIncomparable, |
michael@0 | 299 | "JSVAL_INT_MIN - 1": notEqualIncomparable, |
michael@0 | 300 | "JSVAL_INT_MIN": notEqualIncomparable, |
michael@0 | 301 | "JSVAL_INT_MIN + 1": notEqualIncomparable, |
michael@0 | 302 | "JSVAL_INT_MAX - 1": notEqualIncomparable, |
michael@0 | 303 | "JSVAL_INT_MAX": notEqualIncomparable, |
michael@0 | 304 | "JSVAL_INT_MAX + 1": notEqualIncomparable, |
michael@0 | 305 | "Infinity": notEqualIncomparable, |
michael@0 | 306 | "-Infinity": notEqualIncomparable, |
michael@0 | 307 | "NaN": notEqualIncomparable, |
michael@0 | 308 | "{}": notEqualIncomparable, |
michael@0 | 309 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 310 | "[]": notEqualIncomparable, |
michael@0 | 311 | '[""]': notEqualIncomparable, |
michael@0 | 312 | '["a"]': notEqualIncomparable, |
michael@0 | 313 | "[0]": notEqualIncomparable |
michael@0 | 314 | }, |
michael@0 | 315 | "null": |
michael@0 | 316 | { |
michael@0 | 317 | "undefined": looselyEqualIncomparable, |
michael@0 | 318 | "null": strictlyEqualNotDifferent, |
michael@0 | 319 | "true": notEqualLessThan, |
michael@0 | 320 | "false": notEqualNorDifferent, |
michael@0 | 321 | '""': notEqualNorDifferent, |
michael@0 | 322 | '"a"': notEqualIncomparable, |
michael@0 | 323 | '"Z"': notEqualIncomparable, |
michael@0 | 324 | "0": notEqualNorDifferent, |
michael@0 | 325 | "-0": notEqualNorDifferent, |
michael@0 | 326 | "1": notEqualLessThan, |
michael@0 | 327 | "Math.E": notEqualLessThan, |
michael@0 | 328 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 329 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 330 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 331 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 332 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 333 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 334 | "Infinity": notEqualLessThan, |
michael@0 | 335 | "-Infinity": notEqualGreaterThan, |
michael@0 | 336 | "NaN": notEqualIncomparable, |
michael@0 | 337 | "{}": notEqualIncomparable, |
michael@0 | 338 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 339 | "[]": notEqualNorDifferent, |
michael@0 | 340 | '[""]': notEqualNorDifferent, |
michael@0 | 341 | '["a"]': notEqualIncomparable, |
michael@0 | 342 | "[0]": notEqualNorDifferent |
michael@0 | 343 | }, |
michael@0 | 344 | "true": |
michael@0 | 345 | { |
michael@0 | 346 | "undefined": notEqualIncomparable, |
michael@0 | 347 | "null": notEqualGreaterThan, |
michael@0 | 348 | "true": strictlyEqual, |
michael@0 | 349 | "false": notEqualGreaterThan, |
michael@0 | 350 | '""': notEqualGreaterThan, |
michael@0 | 351 | '"a"': notEqualIncomparable, |
michael@0 | 352 | '"Z"': notEqualIncomparable, |
michael@0 | 353 | "0": notEqualGreaterThan, |
michael@0 | 354 | "-0": notEqualGreaterThan, |
michael@0 | 355 | "1": looselyEqual, |
michael@0 | 356 | "Math.E": notEqualLessThan, |
michael@0 | 357 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 358 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 359 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 360 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 361 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 362 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 363 | "Infinity": notEqualLessThan, |
michael@0 | 364 | "-Infinity": notEqualGreaterThan, |
michael@0 | 365 | "NaN": notEqualIncomparable, |
michael@0 | 366 | "{}": notEqualIncomparable, |
michael@0 | 367 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 368 | "[]": notEqualGreaterThan, |
michael@0 | 369 | '[""]': notEqualGreaterThan, |
michael@0 | 370 | '["a"]': notEqualIncomparable, |
michael@0 | 371 | "[0]": notEqualGreaterThan |
michael@0 | 372 | }, |
michael@0 | 373 | "false": |
michael@0 | 374 | { |
michael@0 | 375 | "undefined": notEqualIncomparable, |
michael@0 | 376 | "null": notEqualNorDifferent, |
michael@0 | 377 | "true": notEqualLessThan, |
michael@0 | 378 | "false": strictlyEqual, |
michael@0 | 379 | '""': looselyEqualNotDifferent, |
michael@0 | 380 | '"a"': notEqualIncomparable, |
michael@0 | 381 | '"Z"': notEqualIncomparable, |
michael@0 | 382 | "0": looselyEqual, |
michael@0 | 383 | "-0": looselyEqual, |
michael@0 | 384 | "1": notEqualLessThan, |
michael@0 | 385 | "Math.E": notEqualLessThan, |
michael@0 | 386 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 387 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 388 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 389 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 390 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 391 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 392 | "Infinity": notEqualLessThan, |
michael@0 | 393 | "-Infinity": notEqualGreaterThan, |
michael@0 | 394 | "NaN": notEqualIncomparable, |
michael@0 | 395 | "{}": notEqualIncomparable, |
michael@0 | 396 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 397 | "[]": looselyEqual, |
michael@0 | 398 | '[""]': looselyEqual, |
michael@0 | 399 | '["a"]': notEqualIncomparable, |
michael@0 | 400 | "[0]": looselyEqual |
michael@0 | 401 | }, |
michael@0 | 402 | '""': |
michael@0 | 403 | { |
michael@0 | 404 | "undefined": notEqualIncomparable, |
michael@0 | 405 | "null": notEqualNorDifferent, |
michael@0 | 406 | "true": notEqualLessThan, |
michael@0 | 407 | "false": looselyEqual, |
michael@0 | 408 | '""': strictlyEqual, |
michael@0 | 409 | '"a"': notEqualLessThan, |
michael@0 | 410 | '"Z"': notEqualLessThan, |
michael@0 | 411 | "0": looselyEqual, |
michael@0 | 412 | "-0": looselyEqual, |
michael@0 | 413 | "1": notEqualLessThan, |
michael@0 | 414 | "Math.E": notEqualLessThan, |
michael@0 | 415 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 416 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 417 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 418 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 419 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 420 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 421 | "Infinity": notEqualLessThan, |
michael@0 | 422 | "-Infinity": notEqualGreaterThan, |
michael@0 | 423 | "NaN": notEqualIncomparable, |
michael@0 | 424 | "{}": notEqualLessThan, |
michael@0 | 425 | "{ valueOf: undefined }": notEqualLessThan, |
michael@0 | 426 | "[]": looselyEqual, |
michael@0 | 427 | '[""]': looselyEqual, |
michael@0 | 428 | '["a"]': notEqualLessThan, |
michael@0 | 429 | "[0]": notEqualLessThan |
michael@0 | 430 | }, |
michael@0 | 431 | '"a"': |
michael@0 | 432 | { |
michael@0 | 433 | "undefined": notEqualIncomparable, |
michael@0 | 434 | "null": notEqualIncomparable, |
michael@0 | 435 | "true": notEqualIncomparable, |
michael@0 | 436 | "false": notEqualIncomparable, |
michael@0 | 437 | '""': notEqualGreaterThan, |
michael@0 | 438 | '"a"': strictlyEqual, |
michael@0 | 439 | '"Z"': notEqualGreaterThan, |
michael@0 | 440 | "0": notEqualIncomparable, |
michael@0 | 441 | "-0": notEqualIncomparable, |
michael@0 | 442 | "1": notEqualIncomparable, |
michael@0 | 443 | "Math.E": notEqualIncomparable, |
michael@0 | 444 | "JSVAL_INT_MIN - 1": notEqualIncomparable, |
michael@0 | 445 | "JSVAL_INT_MIN": notEqualIncomparable, |
michael@0 | 446 | "JSVAL_INT_MIN + 1": notEqualIncomparable, |
michael@0 | 447 | "JSVAL_INT_MAX - 1": notEqualIncomparable, |
michael@0 | 448 | "JSVAL_INT_MAX": notEqualIncomparable, |
michael@0 | 449 | "JSVAL_INT_MAX + 1": notEqualIncomparable, |
michael@0 | 450 | "Infinity": notEqualIncomparable, |
michael@0 | 451 | "-Infinity": notEqualIncomparable, |
michael@0 | 452 | "NaN": notEqualIncomparable, |
michael@0 | 453 | "{}": notEqualGreaterThan, |
michael@0 | 454 | "{ valueOf: undefined }": notEqualGreaterThan, |
michael@0 | 455 | "[]": notEqualGreaterThan, |
michael@0 | 456 | '[""]': notEqualGreaterThan, |
michael@0 | 457 | '["a"]': looselyEqualNotDifferent, |
michael@0 | 458 | "[0]": notEqualGreaterThan |
michael@0 | 459 | }, |
michael@0 | 460 | '"Z"': |
michael@0 | 461 | { |
michael@0 | 462 | "undefined": notEqualIncomparable, |
michael@0 | 463 | "null": notEqualIncomparable, |
michael@0 | 464 | "true": notEqualIncomparable, |
michael@0 | 465 | "false": notEqualIncomparable, |
michael@0 | 466 | '""': notEqualGreaterThan, |
michael@0 | 467 | '"a"': notEqualLessThan, |
michael@0 | 468 | '"Z"': strictlyEqual, |
michael@0 | 469 | "0": notEqualIncomparable, |
michael@0 | 470 | "-0": notEqualIncomparable, |
michael@0 | 471 | "1": notEqualIncomparable, |
michael@0 | 472 | "Math.E": notEqualIncomparable, |
michael@0 | 473 | "JSVAL_INT_MIN - 1": notEqualIncomparable, |
michael@0 | 474 | "JSVAL_INT_MIN": notEqualIncomparable, |
michael@0 | 475 | "JSVAL_INT_MIN + 1": notEqualIncomparable, |
michael@0 | 476 | "JSVAL_INT_MAX - 1": notEqualIncomparable, |
michael@0 | 477 | "JSVAL_INT_MAX": notEqualIncomparable, |
michael@0 | 478 | "JSVAL_INT_MAX + 1": notEqualIncomparable, |
michael@0 | 479 | "Infinity": notEqualIncomparable, |
michael@0 | 480 | "-Infinity": notEqualIncomparable, |
michael@0 | 481 | "NaN": notEqualIncomparable, |
michael@0 | 482 | "{}": notEqualLessThan, |
michael@0 | 483 | "{ valueOf: undefined }": notEqualLessThan, |
michael@0 | 484 | "[]": notEqualGreaterThan, |
michael@0 | 485 | '[""]': notEqualGreaterThan, |
michael@0 | 486 | '["a"]': notEqualLessThan, |
michael@0 | 487 | "[0]": notEqualGreaterThan |
michael@0 | 488 | }, |
michael@0 | 489 | "0": comparingZeroToSomething, |
michael@0 | 490 | "-0": comparingZeroToSomething, |
michael@0 | 491 | "1": |
michael@0 | 492 | { |
michael@0 | 493 | "undefined": notEqualIncomparable, |
michael@0 | 494 | "null": notEqualGreaterThan, |
michael@0 | 495 | "true": looselyEqual, |
michael@0 | 496 | "false": notEqualGreaterThan, |
michael@0 | 497 | '""': notEqualGreaterThan, |
michael@0 | 498 | '"a"': notEqualIncomparable, |
michael@0 | 499 | '"Z"': notEqualIncomparable, |
michael@0 | 500 | "0": notEqualGreaterThan, |
michael@0 | 501 | "-0": notEqualGreaterThan, |
michael@0 | 502 | "1": strictlyEqual, |
michael@0 | 503 | "Math.E": notEqualLessThan, |
michael@0 | 504 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 505 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 506 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 507 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 508 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 509 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 510 | "Infinity": notEqualLessThan, |
michael@0 | 511 | "-Infinity": notEqualGreaterThan, |
michael@0 | 512 | "NaN": notEqualIncomparable, |
michael@0 | 513 | "{}": notEqualIncomparable, |
michael@0 | 514 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 515 | "[]": notEqualGreaterThan, |
michael@0 | 516 | '[""]': notEqualGreaterThan, |
michael@0 | 517 | '["a"]': notEqualIncomparable, |
michael@0 | 518 | "[0]": notEqualGreaterThan |
michael@0 | 519 | }, |
michael@0 | 520 | "Math.E": |
michael@0 | 521 | { |
michael@0 | 522 | "undefined": notEqualIncomparable, |
michael@0 | 523 | "null": notEqualGreaterThan, |
michael@0 | 524 | "true": notEqualGreaterThan, |
michael@0 | 525 | "false": notEqualGreaterThan, |
michael@0 | 526 | '""': notEqualGreaterThan, |
michael@0 | 527 | '"a"': notEqualIncomparable, |
michael@0 | 528 | '"Z"': notEqualIncomparable, |
michael@0 | 529 | "0": notEqualGreaterThan, |
michael@0 | 530 | "-0": notEqualGreaterThan, |
michael@0 | 531 | "1": notEqualGreaterThan, |
michael@0 | 532 | "Math.E": strictlyEqual, |
michael@0 | 533 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 534 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 535 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 536 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 537 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 538 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 539 | "Infinity": notEqualLessThan, |
michael@0 | 540 | "-Infinity": notEqualGreaterThan, |
michael@0 | 541 | "NaN": notEqualIncomparable, |
michael@0 | 542 | "{}": notEqualIncomparable, |
michael@0 | 543 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 544 | "[]": notEqualGreaterThan, |
michael@0 | 545 | '[""]': notEqualGreaterThan, |
michael@0 | 546 | '["a"]': notEqualIncomparable, |
michael@0 | 547 | "[0]": notEqualGreaterThan |
michael@0 | 548 | }, |
michael@0 | 549 | "JSVAL_INT_MIN - 1": |
michael@0 | 550 | { |
michael@0 | 551 | "undefined": notEqualIncomparable, |
michael@0 | 552 | "null": notEqualLessThan, |
michael@0 | 553 | "true": notEqualLessThan, |
michael@0 | 554 | "false": notEqualLessThan, |
michael@0 | 555 | '""': notEqualLessThan, |
michael@0 | 556 | '"a"': notEqualIncomparable, |
michael@0 | 557 | '"Z"': notEqualIncomparable, |
michael@0 | 558 | "0": notEqualLessThan, |
michael@0 | 559 | "-0": notEqualLessThan, |
michael@0 | 560 | "1": notEqualLessThan, |
michael@0 | 561 | "Math.E": notEqualLessThan, |
michael@0 | 562 | "JSVAL_INT_MIN - 1": strictlyEqual, |
michael@0 | 563 | "JSVAL_INT_MIN": notEqualLessThan, |
michael@0 | 564 | "JSVAL_INT_MIN + 1": notEqualLessThan, |
michael@0 | 565 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 566 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 567 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 568 | "Infinity": notEqualLessThan, |
michael@0 | 569 | "-Infinity": notEqualGreaterThan, |
michael@0 | 570 | "NaN": notEqualIncomparable, |
michael@0 | 571 | "{}": notEqualIncomparable, |
michael@0 | 572 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 573 | "[]": notEqualLessThan, |
michael@0 | 574 | '[""]': notEqualLessThan, |
michael@0 | 575 | '["a"]': notEqualIncomparable, |
michael@0 | 576 | "[0]": notEqualLessThan |
michael@0 | 577 | }, |
michael@0 | 578 | "JSVAL_INT_MIN": |
michael@0 | 579 | { |
michael@0 | 580 | "undefined": notEqualIncomparable, |
michael@0 | 581 | "null": notEqualLessThan, |
michael@0 | 582 | "true": notEqualLessThan, |
michael@0 | 583 | "false": notEqualLessThan, |
michael@0 | 584 | '""': notEqualLessThan, |
michael@0 | 585 | '"a"': notEqualIncomparable, |
michael@0 | 586 | '"Z"': notEqualIncomparable, |
michael@0 | 587 | "0": notEqualLessThan, |
michael@0 | 588 | "-0": notEqualLessThan, |
michael@0 | 589 | "1": notEqualLessThan, |
michael@0 | 590 | "Math.E": notEqualLessThan, |
michael@0 | 591 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 592 | "JSVAL_INT_MIN": strictlyEqual, |
michael@0 | 593 | "JSVAL_INT_MIN + 1": notEqualLessThan, |
michael@0 | 594 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 595 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 596 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 597 | "Infinity": notEqualLessThan, |
michael@0 | 598 | "-Infinity": notEqualGreaterThan, |
michael@0 | 599 | "NaN": notEqualIncomparable, |
michael@0 | 600 | "{}": notEqualIncomparable, |
michael@0 | 601 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 602 | "[]": notEqualLessThan, |
michael@0 | 603 | '[""]': notEqualLessThan, |
michael@0 | 604 | '["a"]': notEqualIncomparable, |
michael@0 | 605 | "[0]": notEqualLessThan |
michael@0 | 606 | }, |
michael@0 | 607 | "JSVAL_INT_MIN + 1": |
michael@0 | 608 | { |
michael@0 | 609 | "undefined": notEqualIncomparable, |
michael@0 | 610 | "null": notEqualLessThan, |
michael@0 | 611 | "true": notEqualLessThan, |
michael@0 | 612 | "false": notEqualLessThan, |
michael@0 | 613 | '""': notEqualLessThan, |
michael@0 | 614 | '"a"': notEqualIncomparable, |
michael@0 | 615 | '"Z"': notEqualIncomparable, |
michael@0 | 616 | "0": notEqualLessThan, |
michael@0 | 617 | "-0": notEqualLessThan, |
michael@0 | 618 | "1": notEqualLessThan, |
michael@0 | 619 | "Math.E": notEqualLessThan, |
michael@0 | 620 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 621 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 622 | "JSVAL_INT_MIN + 1": strictlyEqual, |
michael@0 | 623 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 624 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 625 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 626 | "Infinity": notEqualLessThan, |
michael@0 | 627 | "-Infinity": notEqualGreaterThan, |
michael@0 | 628 | "NaN": notEqualIncomparable, |
michael@0 | 629 | "{}": notEqualIncomparable, |
michael@0 | 630 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 631 | "[]": notEqualLessThan, |
michael@0 | 632 | '[""]': notEqualLessThan, |
michael@0 | 633 | '["a"]': notEqualIncomparable, |
michael@0 | 634 | "[0]": notEqualLessThan |
michael@0 | 635 | }, |
michael@0 | 636 | "JSVAL_INT_MAX - 1": |
michael@0 | 637 | { |
michael@0 | 638 | "undefined": notEqualIncomparable, |
michael@0 | 639 | "null": notEqualGreaterThan, |
michael@0 | 640 | "true": notEqualGreaterThan, |
michael@0 | 641 | "false": notEqualGreaterThan, |
michael@0 | 642 | '""': notEqualGreaterThan, |
michael@0 | 643 | '"a"': notEqualIncomparable, |
michael@0 | 644 | '"Z"': notEqualIncomparable, |
michael@0 | 645 | "0": notEqualGreaterThan, |
michael@0 | 646 | "-0": notEqualGreaterThan, |
michael@0 | 647 | "1": notEqualGreaterThan, |
michael@0 | 648 | "Math.E": notEqualGreaterThan, |
michael@0 | 649 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 650 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 651 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 652 | "JSVAL_INT_MAX - 1": strictlyEqual, |
michael@0 | 653 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 654 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 655 | "Infinity": notEqualLessThan, |
michael@0 | 656 | "-Infinity": notEqualGreaterThan, |
michael@0 | 657 | "NaN": notEqualIncomparable, |
michael@0 | 658 | "{}": notEqualIncomparable, |
michael@0 | 659 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 660 | "[]": notEqualGreaterThan, |
michael@0 | 661 | '[""]': notEqualGreaterThan, |
michael@0 | 662 | '["a"]': notEqualIncomparable, |
michael@0 | 663 | "[0]": notEqualGreaterThan |
michael@0 | 664 | }, |
michael@0 | 665 | "JSVAL_INT_MAX": |
michael@0 | 666 | { |
michael@0 | 667 | "undefined": notEqualIncomparable, |
michael@0 | 668 | "null": notEqualGreaterThan, |
michael@0 | 669 | "true": notEqualGreaterThan, |
michael@0 | 670 | "false": notEqualGreaterThan, |
michael@0 | 671 | '""': notEqualGreaterThan, |
michael@0 | 672 | '"a"': notEqualIncomparable, |
michael@0 | 673 | '"Z"': notEqualIncomparable, |
michael@0 | 674 | "0": notEqualGreaterThan, |
michael@0 | 675 | "-0": notEqualGreaterThan, |
michael@0 | 676 | "1": notEqualGreaterThan, |
michael@0 | 677 | "Math.E": notEqualGreaterThan, |
michael@0 | 678 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 679 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 680 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 681 | "JSVAL_INT_MAX - 1": notEqualGreaterThan, |
michael@0 | 682 | "JSVAL_INT_MAX": strictlyEqual, |
michael@0 | 683 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 684 | "Infinity": notEqualLessThan, |
michael@0 | 685 | "-Infinity": notEqualGreaterThan, |
michael@0 | 686 | "NaN": notEqualIncomparable, |
michael@0 | 687 | "{}": notEqualIncomparable, |
michael@0 | 688 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 689 | "[]": notEqualGreaterThan, |
michael@0 | 690 | '[""]': notEqualGreaterThan, |
michael@0 | 691 | '["a"]': notEqualIncomparable, |
michael@0 | 692 | "[0]": notEqualGreaterThan |
michael@0 | 693 | }, |
michael@0 | 694 | "JSVAL_INT_MAX + 1": |
michael@0 | 695 | { |
michael@0 | 696 | "undefined": notEqualIncomparable, |
michael@0 | 697 | "null": notEqualGreaterThan, |
michael@0 | 698 | "true": notEqualGreaterThan, |
michael@0 | 699 | "false": notEqualGreaterThan, |
michael@0 | 700 | '""': notEqualGreaterThan, |
michael@0 | 701 | '"a"': notEqualIncomparable, |
michael@0 | 702 | '"Z"': notEqualIncomparable, |
michael@0 | 703 | "0": notEqualGreaterThan, |
michael@0 | 704 | "-0": notEqualGreaterThan, |
michael@0 | 705 | "1": notEqualGreaterThan, |
michael@0 | 706 | "Math.E": notEqualGreaterThan, |
michael@0 | 707 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 708 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 709 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 710 | "JSVAL_INT_MAX - 1": notEqualGreaterThan, |
michael@0 | 711 | "JSVAL_INT_MAX": notEqualGreaterThan, |
michael@0 | 712 | "JSVAL_INT_MAX + 1": strictlyEqual, |
michael@0 | 713 | "Infinity": notEqualLessThan, |
michael@0 | 714 | "-Infinity": notEqualGreaterThan, |
michael@0 | 715 | "NaN": notEqualIncomparable, |
michael@0 | 716 | "{}": notEqualIncomparable, |
michael@0 | 717 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 718 | "[]": notEqualGreaterThan, |
michael@0 | 719 | '[""]': notEqualGreaterThan, |
michael@0 | 720 | '["a"]': notEqualIncomparable, |
michael@0 | 721 | "[0]": notEqualGreaterThan |
michael@0 | 722 | }, |
michael@0 | 723 | "Infinity": |
michael@0 | 724 | { |
michael@0 | 725 | "undefined": notEqualIncomparable, |
michael@0 | 726 | "null": notEqualGreaterThan, |
michael@0 | 727 | "true": notEqualGreaterThan, |
michael@0 | 728 | "false": notEqualGreaterThan, |
michael@0 | 729 | '""': notEqualGreaterThan, |
michael@0 | 730 | '"a"': notEqualIncomparable, |
michael@0 | 731 | '"Z"': notEqualIncomparable, |
michael@0 | 732 | "0": notEqualGreaterThan, |
michael@0 | 733 | "-0": notEqualGreaterThan, |
michael@0 | 734 | "1": notEqualGreaterThan, |
michael@0 | 735 | "Math.E": notEqualGreaterThan, |
michael@0 | 736 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 737 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 738 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 739 | "JSVAL_INT_MAX - 1": notEqualGreaterThan, |
michael@0 | 740 | "JSVAL_INT_MAX": notEqualGreaterThan, |
michael@0 | 741 | "JSVAL_INT_MAX + 1": notEqualGreaterThan, |
michael@0 | 742 | "Infinity": strictlyEqual, |
michael@0 | 743 | "-Infinity": notEqualGreaterThan, |
michael@0 | 744 | "NaN": notEqualIncomparable, |
michael@0 | 745 | "{}": notEqualIncomparable, |
michael@0 | 746 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 747 | "[]": notEqualGreaterThan, |
michael@0 | 748 | '[""]': notEqualGreaterThan, |
michael@0 | 749 | '["a"]': notEqualIncomparable, |
michael@0 | 750 | "[0]": notEqualGreaterThan |
michael@0 | 751 | }, |
michael@0 | 752 | "-Infinity": |
michael@0 | 753 | { |
michael@0 | 754 | "undefined": notEqualIncomparable, |
michael@0 | 755 | "null": notEqualLessThan, |
michael@0 | 756 | "true": notEqualLessThan, |
michael@0 | 757 | "false": notEqualLessThan, |
michael@0 | 758 | '""': notEqualLessThan, |
michael@0 | 759 | '"a"': notEqualIncomparable, |
michael@0 | 760 | '"Z"': notEqualIncomparable, |
michael@0 | 761 | "0": notEqualLessThan, |
michael@0 | 762 | "-0": notEqualLessThan, |
michael@0 | 763 | "1": notEqualLessThan, |
michael@0 | 764 | "Math.E": notEqualLessThan, |
michael@0 | 765 | "JSVAL_INT_MIN - 1": notEqualLessThan, |
michael@0 | 766 | "JSVAL_INT_MIN": notEqualLessThan, |
michael@0 | 767 | "JSVAL_INT_MIN + 1": notEqualLessThan, |
michael@0 | 768 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 769 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 770 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 771 | "Infinity": notEqualLessThan, |
michael@0 | 772 | "-Infinity": strictlyEqual, |
michael@0 | 773 | "NaN": notEqualIncomparable, |
michael@0 | 774 | "{}": notEqualIncomparable, |
michael@0 | 775 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 776 | "[]": notEqualLessThan, |
michael@0 | 777 | '[""]': notEqualLessThan, |
michael@0 | 778 | '["a"]': notEqualIncomparable, |
michael@0 | 779 | "[0]": notEqualLessThan |
michael@0 | 780 | }, |
michael@0 | 781 | "NaN": |
michael@0 | 782 | { |
michael@0 | 783 | "undefined": notEqualIncomparable, |
michael@0 | 784 | "null": notEqualIncomparable, |
michael@0 | 785 | "true": notEqualIncomparable, |
michael@0 | 786 | "false": notEqualIncomparable, |
michael@0 | 787 | '""': notEqualIncomparable, |
michael@0 | 788 | '"a"': notEqualIncomparable, |
michael@0 | 789 | '"Z"': notEqualIncomparable, |
michael@0 | 790 | "0": notEqualIncomparable, |
michael@0 | 791 | "-0": notEqualIncomparable, |
michael@0 | 792 | "1": notEqualIncomparable, |
michael@0 | 793 | "Math.E": notEqualIncomparable, |
michael@0 | 794 | "JSVAL_INT_MIN - 1": notEqualIncomparable, |
michael@0 | 795 | "JSVAL_INT_MIN": notEqualIncomparable, |
michael@0 | 796 | "JSVAL_INT_MIN + 1": notEqualIncomparable, |
michael@0 | 797 | "JSVAL_INT_MAX - 1": notEqualIncomparable, |
michael@0 | 798 | "JSVAL_INT_MAX": notEqualIncomparable, |
michael@0 | 799 | "JSVAL_INT_MAX + 1": notEqualIncomparable, |
michael@0 | 800 | "Infinity": notEqualIncomparable, |
michael@0 | 801 | "-Infinity": notEqualIncomparable, |
michael@0 | 802 | "NaN": notEqualIncomparable, |
michael@0 | 803 | "{}": notEqualIncomparable, |
michael@0 | 804 | "{ valueOf: undefined }": notEqualIncomparable, |
michael@0 | 805 | "[]": notEqualIncomparable, |
michael@0 | 806 | '[""]': notEqualIncomparable, |
michael@0 | 807 | '["a"]': notEqualIncomparable, |
michael@0 | 808 | "[0]": notEqualIncomparable |
michael@0 | 809 | }, |
michael@0 | 810 | "{}": comparingObjectOrObjectWithValueUndefined, |
michael@0 | 811 | "{ valueOf: undefined }": comparingObjectOrObjectWithValueUndefined, |
michael@0 | 812 | "[]": |
michael@0 | 813 | { |
michael@0 | 814 | "undefined": notEqualIncomparable, |
michael@0 | 815 | "null": notEqualNorDifferent, |
michael@0 | 816 | "true": notEqualLessThan, |
michael@0 | 817 | "false": looselyEqual, |
michael@0 | 818 | '""': looselyEqual, |
michael@0 | 819 | '"a"': notEqualLessThan, |
michael@0 | 820 | '"Z"': notEqualLessThan, |
michael@0 | 821 | "0": looselyEqual, |
michael@0 | 822 | "-0": looselyEqual, |
michael@0 | 823 | "1": notEqualLessThan, |
michael@0 | 824 | "Math.E": notEqualLessThan, |
michael@0 | 825 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 826 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 827 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 828 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 829 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 830 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 831 | "Infinity": notEqualLessThan, |
michael@0 | 832 | "-Infinity": notEqualGreaterThan, |
michael@0 | 833 | "NaN": notEqualIncomparable, |
michael@0 | 834 | "{}": notEqualLessThan, |
michael@0 | 835 | "{ valueOf: undefined }": notEqualLessThan, |
michael@0 | 836 | "[]": notEqualNorDifferent, |
michael@0 | 837 | '[""]': notEqualNorDifferent, |
michael@0 | 838 | '["a"]': notEqualLessThan, |
michael@0 | 839 | "[0]": notEqualLessThan |
michael@0 | 840 | }, |
michael@0 | 841 | '[""]': |
michael@0 | 842 | { |
michael@0 | 843 | "undefined": notEqualIncomparable, |
michael@0 | 844 | "null": notEqualNorDifferent, |
michael@0 | 845 | "true": notEqualLessThan, |
michael@0 | 846 | "false": looselyEqual, |
michael@0 | 847 | '""': looselyEqual, |
michael@0 | 848 | '"a"': notEqualLessThan, |
michael@0 | 849 | '"Z"': notEqualLessThan, |
michael@0 | 850 | "0": looselyEqual, |
michael@0 | 851 | "-0": looselyEqual, |
michael@0 | 852 | "1": notEqualLessThan, |
michael@0 | 853 | "Math.E": notEqualLessThan, |
michael@0 | 854 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 855 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 856 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 857 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 858 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 859 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 860 | "Infinity": notEqualLessThan, |
michael@0 | 861 | "-Infinity": notEqualGreaterThan, |
michael@0 | 862 | "NaN": notEqualIncomparable, |
michael@0 | 863 | "{}": notEqualLessThan, |
michael@0 | 864 | "{ valueOf: undefined }": notEqualLessThan, |
michael@0 | 865 | "[]": notEqualNorDifferent, |
michael@0 | 866 | '[""]': notEqualNorDifferent, |
michael@0 | 867 | '["a"]': notEqualLessThan, |
michael@0 | 868 | "[0]": notEqualLessThan |
michael@0 | 869 | }, |
michael@0 | 870 | '["a"]': |
michael@0 | 871 | { |
michael@0 | 872 | "undefined": notEqualIncomparable, |
michael@0 | 873 | "null": notEqualIncomparable, |
michael@0 | 874 | "true": notEqualIncomparable, |
michael@0 | 875 | "false": notEqualIncomparable, |
michael@0 | 876 | '""': notEqualGreaterThan, |
michael@0 | 877 | '"a"': looselyEqual, |
michael@0 | 878 | '"Z"': notEqualGreaterThan, |
michael@0 | 879 | "0": notEqualIncomparable, |
michael@0 | 880 | "-0": notEqualIncomparable, |
michael@0 | 881 | "1": notEqualIncomparable, |
michael@0 | 882 | "Math.E": notEqualIncomparable, |
michael@0 | 883 | "JSVAL_INT_MIN - 1": notEqualIncomparable, |
michael@0 | 884 | "JSVAL_INT_MIN": notEqualIncomparable, |
michael@0 | 885 | "JSVAL_INT_MIN + 1": notEqualIncomparable, |
michael@0 | 886 | "JSVAL_INT_MAX - 1": notEqualIncomparable, |
michael@0 | 887 | "JSVAL_INT_MAX": notEqualIncomparable, |
michael@0 | 888 | "JSVAL_INT_MAX + 1": notEqualIncomparable, |
michael@0 | 889 | "Infinity": notEqualIncomparable, |
michael@0 | 890 | "-Infinity": notEqualIncomparable, |
michael@0 | 891 | "NaN": notEqualIncomparable, |
michael@0 | 892 | "{}": notEqualGreaterThan, |
michael@0 | 893 | "{ valueOf: undefined }": notEqualGreaterThan, |
michael@0 | 894 | "[]": notEqualGreaterThan, |
michael@0 | 895 | '[""]': notEqualGreaterThan, |
michael@0 | 896 | '["a"]': notEqualNorDifferent, |
michael@0 | 897 | "[0]": notEqualGreaterThan |
michael@0 | 898 | }, |
michael@0 | 899 | "[0]": |
michael@0 | 900 | { |
michael@0 | 901 | "undefined": notEqualIncomparable, |
michael@0 | 902 | "null": notEqualNorDifferent, |
michael@0 | 903 | "true": notEqualLessThan, |
michael@0 | 904 | "false": looselyEqual, |
michael@0 | 905 | '""': notEqualGreaterThan, |
michael@0 | 906 | '"a"': notEqualLessThan, |
michael@0 | 907 | '"Z"': notEqualLessThan, |
michael@0 | 908 | "0": looselyEqual, |
michael@0 | 909 | "-0": looselyEqual, |
michael@0 | 910 | "1": notEqualLessThan, |
michael@0 | 911 | "Math.E": notEqualLessThan, |
michael@0 | 912 | "JSVAL_INT_MIN - 1": notEqualGreaterThan, |
michael@0 | 913 | "JSVAL_INT_MIN": notEqualGreaterThan, |
michael@0 | 914 | "JSVAL_INT_MIN + 1": notEqualGreaterThan, |
michael@0 | 915 | "JSVAL_INT_MAX - 1": notEqualLessThan, |
michael@0 | 916 | "JSVAL_INT_MAX": notEqualLessThan, |
michael@0 | 917 | "JSVAL_INT_MAX + 1": notEqualLessThan, |
michael@0 | 918 | "Infinity": notEqualLessThan, |
michael@0 | 919 | "-Infinity": notEqualGreaterThan, |
michael@0 | 920 | "NaN": notEqualIncomparable, |
michael@0 | 921 | "{}": notEqualLessThan, |
michael@0 | 922 | "{ valueOf: undefined }": notEqualLessThan, |
michael@0 | 923 | "[]": notEqualGreaterThan, |
michael@0 | 924 | '[""]': notEqualGreaterThan, |
michael@0 | 925 | '["a"]': notEqualLessThan, |
michael@0 | 926 | "[0]": notEqualNorDifferent |
michael@0 | 927 | } |
michael@0 | 928 | }; |
michael@0 | 929 | |
michael@0 | 930 | |
michael@0 | 931 | |
michael@0 | 932 | var failures = []; |
michael@0 | 933 | function fail(a, ta, b, tb, ex, ac, op) |
michael@0 | 934 | { |
michael@0 | 935 | failures.push("(" + a + " " + op + " " + b + ") wrong: " + |
michael@0 | 936 | "expected " + ex + ", got " + ac + |
michael@0 | 937 | " (types " + types[ta] + ", " + types[tb] + ")"); |
michael@0 | 938 | } |
michael@0 | 939 | |
michael@0 | 940 | var result = false; |
michael@0 | 941 | for (var i in values) |
michael@0 | 942 | { |
michael@0 | 943 | for (var j in values) |
michael@0 | 944 | { |
michael@0 | 945 | // Constants, so hoist to help JIT know that |
michael@0 | 946 | var vala = values[i], valb = values[j]; |
michael@0 | 947 | var a = vala.value(), b = valb.value(); |
michael@0 | 948 | |
michael@0 | 949 | for (var opname in orderOps) |
michael@0 | 950 | { |
michael@0 | 951 | var op = orderOps[opname]; |
michael@0 | 952 | var expect = expected[i][j].order[opname]; |
michael@0 | 953 | var failed = false; |
michael@0 | 954 | |
michael@0 | 955 | for (var iter = 0; iter < 5; iter++) |
michael@0 | 956 | { |
michael@0 | 957 | result = op(a, b); |
michael@0 | 958 | failed = failed || result !== expect; |
michael@0 | 959 | } |
michael@0 | 960 | |
michael@0 | 961 | if (failed) |
michael@0 | 962 | fail(i, vala.type, j, valb.type, expect, result, opname); |
michael@0 | 963 | } |
michael@0 | 964 | |
michael@0 | 965 | for (var opname in eqOps) |
michael@0 | 966 | { |
michael@0 | 967 | var op = eqOps[opname]; |
michael@0 | 968 | var expect = expected[i][j].eq[opname]; |
michael@0 | 969 | var failed = false; |
michael@0 | 970 | |
michael@0 | 971 | for (var iter = 0; iter < 5; iter++) |
michael@0 | 972 | { |
michael@0 | 973 | result = op(a, b); |
michael@0 | 974 | failed = failed || result !== expect; |
michael@0 | 975 | } |
michael@0 | 976 | |
michael@0 | 977 | if (failed) |
michael@0 | 978 | fail(i, vala.type, j, valb.type, expect, result, opname); |
michael@0 | 979 | } |
michael@0 | 980 | } |
michael@0 | 981 | } |
michael@0 | 982 | |
michael@0 | 983 | if (failures.length == 0) |
michael@0 | 984 | return "no failures reported!"; |
michael@0 | 985 | |
michael@0 | 986 | return "\n" + failures.join(",\n"); |
michael@0 | 987 | } |
michael@0 | 988 | assertEq(testComparisons(), "no failures reported!"); |