| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 var names = mirror.propertyNames(); | 68 var names = mirror.propertyNames(); |
| 69 var properties = mirror.properties() | 69 var properties = mirror.properties() |
| 70 assertEquals(names.length, properties.length); | 70 assertEquals(names.length, properties.length); |
| 71 for (var i = 0; i < properties.length; i++) { | 71 for (var i = 0; i < properties.length; i++) { |
| 72 assertTrue(properties[i] instanceof debug.Mirror, 'Unexpected mirror hierach
y'); | 72 assertTrue(properties[i] instanceof debug.Mirror, 'Unexpected mirror hierach
y'); |
| 73 assertTrue(properties[i] instanceof debug.PropertyMirror, 'Unexpected mirror
hierachy'); | 73 assertTrue(properties[i] instanceof debug.PropertyMirror, 'Unexpected mirror
hierachy'); |
| 74 assertEquals('property', properties[i].type(), 'Unexpected mirror type'); | 74 assertEquals('property', properties[i].type(), 'Unexpected mirror type'); |
| 75 assertEquals(names[i], properties[i].name(), 'Unexpected property name'); | 75 assertEquals(names[i], properties[i].name(), 'Unexpected property name'); |
| 76 } | 76 } |
| 77 | 77 |
| 78 for (var p in obj) { | 78 for (var p in obj) { |
| 79 var property_mirror = mirror.property(p); | 79 var property_mirror = mirror.property(p); |
| 80 assertTrue(property_mirror instanceof debug.PropertyMirror); | 80 assertTrue(property_mirror instanceof debug.PropertyMirror); |
| 81 assertEquals(p, property_mirror.name()); | 81 assertEquals(p, property_mirror.name()); |
| 82 // If the object has some special properties don't test for these. | 82 // If the object has some special properties don't test for these. |
| 83 if (!hasSpecialProperties) { | 83 if (!hasSpecialProperties) { |
| 84 assertEquals(0, property_mirror.attributes(), property_mirror.name()); | 84 assertEquals(0, property_mirror.attributes(), property_mirror.name()); |
| 85 assertFalse(property_mirror.isReadOnly()); | 85 assertFalse(property_mirror.isReadOnly()); |
| 86 assertTrue(property_mirror.isEnum()); | 86 assertTrue(property_mirror.isEnum()); |
| 87 assertTrue(property_mirror.canDelete()); | 87 assertTrue(property_mirror.canDelete()); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 // Test objects with native accessors. | 219 // Test objects with native accessors. |
| 220 mirror = debug.MakeMirror(new String('abc')); | 220 mirror = debug.MakeMirror(new String('abc')); |
| 221 assertTrue(mirror instanceof debug.ObjectMirror); | 221 assertTrue(mirror instanceof debug.ObjectMirror); |
| 222 assertFalse(mirror.property('length').hasGetter()); | 222 assertFalse(mirror.property('length').hasGetter()); |
| 223 assertFalse(mirror.property('length').hasSetter()); | 223 assertFalse(mirror.property('length').hasSetter()); |
| 224 assertTrue(mirror.property('length').isNative()); | 224 assertTrue(mirror.property('length').isNative()); |
| 225 assertEquals('a', mirror.property(0).value().value()); | 225 assertEquals('a', mirror.property(0).value().value()); |
| 226 assertEquals('b', mirror.property(1).value().value()); | 226 assertEquals('b', mirror.property(1).value().value()); |
| 227 assertEquals('c', mirror.property(2).value().value()); | 227 assertEquals('c', mirror.property(2).value().value()); |
| OLD | NEW |