Chromium Code Reviews| Index: test/mjsunit/mirror-object.js |
| =================================================================== |
| --- test/mjsunit/mirror-object.js (revision 1106) |
| +++ test/mjsunit/mirror-object.js (working copy) |
| @@ -135,7 +135,12 @@ |
| assertEquals(properties[i].value().type(), o.type, 'Unexpected serialized property type for ' + name); |
| if (properties[i].value().isPrimitive()) { |
| - assertEquals(properties[i].value().value(), o.value, 'Unexpected serialized property value for ' + name); |
| + // Special check for NaN as NaN == NaN is false. |
| + if (properties[i].value().isNumber() && isNaN(properties[i].value().value())) { |
|
Mads Ager (chromium)
2009/01/21 09:18:34
A couple of long lines here.
Søren Thygesen Gjesse
2009/01/21 09:31:40
I know, it is in a mjsunit test, which have a lot
|
| + assertEquals('NaN', o.value, 'Unexpected serialized property value for ' + name); |
| + } else { |
| + assertEquals(properties[i].value().value(), o.value, 'Unexpected serialized property value for ' + name); |
| + } |
| } else if (properties[i].value().isFunction()) { |
| assertEquals(properties[i].value().source(), o.source, 'Unexpected serialized property value for ' + name); |
| } |
| @@ -159,6 +164,7 @@ |
| testObjectMirror({'1':void 0,'2':null,'f':function pow(x,y){return Math.pow(x,y);}}, 'Object', 'Object'); |
| testObjectMirror(new Point(-1.2,2.003), 'Object', 'Point'); |
| testObjectMirror(this, 'global', '', true); // Global object has special properties |
| +testObjectMirror(this.__proto__, 'Object', ''); |
| testObjectMirror([], 'Array', 'Array'); |
| testObjectMirror([1,2], 'Array', 'Array'); |