| 110 | }; |
| 111 | |
| 112 | const testEnumerables = (obj, clazz) => { |
| 113 | // Object.keys: only object without prototype |
| 114 | assert(Object.keys(obj).length === 2); |
| 115 | assert(Object.keys(obj).includes('ownProperty')); |
| 116 | assert(Object.keys(obj).indexOf('ownPropertyT') >= 0); |
| 117 | |
| 118 | // for..in: object and prototype |
| 119 | { |
| 120 | const keys = []; |
| 121 | for (const key in obj) { |
| 122 | keys.push(key); |
| 123 | } |
| 124 | |
| 125 | assert(keys.length === 6); |
| 126 | // on prototype |
| 127 | assert(keys.includes('testGetSet')); |
| 128 | assert(keys.includes('testGetter')); |
| 129 | assert(keys.includes('testValue')); |
| 130 | assert(keys.includes('testMethod')); |
| 131 | // on object only |
| 132 | assert(keys.includes('ownProperty')); |
| 133 | assert(keys.includes('ownPropertyT')); |
| 134 | } |
| 135 | }; |
| 136 | |
| 137 | const testConventions = (obj, clazz) => { |
| 138 | // test @@toStringTag |