Chromium Code Reviews| Index: test/mjsunit/mirror-object.js |
| diff --git a/test/mjsunit/mirror-object.js b/test/mjsunit/mirror-object.js |
| index 188855497d2322e4999d37725db1a4e302229380..2423fa5ce1fe24959d642651e144976c1420725f 100644 |
| --- a/test/mjsunit/mirror-object.js |
| +++ b/test/mjsunit/mirror-object.js |
| @@ -38,7 +38,7 @@ function MirrorRefCache(json_refs) { |
| MirrorRefCache.prototype.lookup = function(handle) { |
| return this.refs_[handle]; |
| -} |
| +}; |
| function testObjectMirror(obj, cls_name, ctor_name, hasSpecialProperties) { |
| // Create mirror and JSON representation. |
| @@ -66,7 +66,7 @@ function testObjectMirror(obj, cls_name, ctor_name, hasSpecialProperties) { |
| assertFalse(mirror.hasIndexedInterceptor(), 'No indexed interceptor expected'); |
| var names = mirror.propertyNames(); |
| - var properties = mirror.properties() |
| + var properties = mirror.properties(); |
| assertEquals(names.length, properties.length); |
| for (var i = 0; i < properties.length; i++) { |
| assertTrue(properties[i] instanceof debug.Mirror, 'Unexpected mirror hierachy'); |
| @@ -130,16 +130,15 @@ function testObjectMirror(obj, cls_name, ctor_name, hasSpecialProperties) { |
| assertTrue(typeof(fromJSON.properties[i].attributes) === 'undefined', 'Unexpected serialized attributes'); |
| } |
| - // Lookup the serialized object from the handle reference. |
| + // Lookup the serialized object from the handle reference. |
| var o = refs.lookup(fromJSON.properties[i].ref); |
| assertTrue(o != void 0, 'Referenced object is not serialized'); |
| assertEquals(properties[i].value().type(), o.type, 'Unexpected serialized property type for ' + name); |
| if (properties[i].value().isPrimitive()) { |
| - // Special check for NaN as NaN == NaN is false. |
| - if (properties[i].value().isNumber() && isNaN(properties[i].value().value())) { |
| - assertEquals('NaN', o.value, 'Unexpected serialized property value for ' + name); |
| - } else { |
| + if (!properties[i].value().type() == "null" && |
| + !properties[i].value().type() == "undefined") { |
| + // Null and undefined has no value property. |
| assertEquals(properties[i].value().value(), o.value, 'Unexpected serialized property value for ' + name); |
| } |
|
Søren Thygesen Gjesse
2011/04/15 10:20:51
Should we test that there actually is no value pro
Lasse Reichstein
2011/04/15 11:33:54
let's.
Also, it seems I need to handle that NaN an
|
| } else if (properties[i].value().isFunction()) { |
| @@ -156,7 +155,7 @@ function testObjectMirror(obj, cls_name, ctor_name, hasSpecialProperties) { |
| function Point(x,y) { |
| this.x_ = x; |
| this.y_ = y; |
| -} |
| +}1 |
|
Søren Thygesen Gjesse
2011/04/15 10:20:51
1 -> ;
Lasse Reichstein
2011/04/15 11:33:54
Removed the spurious "1".
|
| // Test a number of different objects. |
| testObjectMirror({}, 'Object', 'Object'); |