MCPcopy Create free account
hub / github.com/phaserjs/phaser / getProperty

Function getProperty

src/utils/Class.js:14–45  ·  view source on GitHub ↗
(definition, k, isClassDescriptor)

Source from the content-addressed store, hash-verified

12}
13
14function 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
47function hasNonConfigurable (obj, k)
48{

Callers 1

extendFunction · 0.85

Calls 1

hasGetterOrSetterFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…