(definition, k, isClassDescriptor)
| 12 | } |
| 13 | |
| 14 | function getProperty (definition, k, isClassDescriptor) |
| 15 | { |
| 16 | // This may be a lightweight object, OR it might be a property that was defined previously. |
| 17 | |
| 18 | // For simple class descriptors we can just assume its NOT previously defined. |
| 19 | var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k); |
| 20 | |
| 21 | if (!isClassDescriptor && def.value && typeof def.value === 'object') |
| 22 | { |
| 23 | def = def.value; |
| 24 | } |
| 25 | |
| 26 | // This might be a regular property, or it may be a getter/setter the user defined in a class. |
| 27 | if (def && hasGetterOrSetter(def)) |
| 28 | { |
| 29 | if (typeof def.enumerable === 'undefined') |
| 30 | { |
| 31 | def.enumerable = true; |
| 32 | } |
| 33 | |
| 34 | if (typeof def.configurable === 'undefined') |
| 35 | { |
| 36 | def.configurable = true; |
| 37 | } |
| 38 | |
| 39 | return def; |
| 40 | } |
| 41 | else |
| 42 | { |
| 43 | return false; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | function hasNonConfigurable (obj, k) |
| 48 | { |
no test coverage detected
searching dependent graphs…