MCPcopy Create free account
hub / github.com/dynjs/dynjs / get

Method get

src/main/java/org/dynjs/runtime/DynObject.java:83–117  ·  view source on GitHub ↗
(ExecutionContext context, String name)

Source from the content-addressed store, hash-verified

81 }
82
83 @Override
84 public Object get(ExecutionContext context, String name) {
85 if ( this.externalIndexedData != null ) {
86 Long num = Types.toUint32(context, name);
87 if ( name.equals( num.toString() ) ) {
88 Object value = this.externalIndexedData.get(num);
89 if ( value == null ) {
90 return Types.UNDEFINED;
91 }
92 return value;
93 }
94 }
95 // 8.12.3
96 Object d = getProperty(context, name, false);
97 if (d == Types.UNDEFINED) {
98 return Types.UNDEFINED;
99 }
100
101 PropertyDescriptor desc = (PropertyDescriptor) d;
102 if (desc.isDataDescriptor()) {
103 Object value = desc.getValue();
104 if (value == null) {
105 value = Types.UNDEFINED;
106 }
107 return value;
108 }
109
110 Object g = desc.getGetter();
111 if (g == null || g == Types.UNDEFINED) {
112 return Types.UNDEFINED;
113 }
114
115 JSFunction getter = (JSFunction) g;
116 return context.call(getter, this);
117 }
118
119 @Override
120 public Object getOwnProperty(ExecutionContext context, String name) {

Callers 8

testBasicThrownErrorMethod · 0.95
defaultValueMethod · 0.95
putMethod · 0.95
removeMethod · 0.95
RequireMethod · 0.95
callMethod · 0.95

Calls 8

toUint32Method · 0.95
getPropertyMethod · 0.95
isDataDescriptorMethod · 0.95
getValueMethod · 0.95
getGetterMethod · 0.95
getMethod · 0.65
callMethod · 0.65
toStringMethod · 0.45

Tested by 3

testBasicThrownErrorMethod · 0.76