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

Method primitiveGet

src/main/java/org/dynjs/runtime/Reference.java:62–85  ·  view source on GitHub ↗
(ExecutionContext context, JSObject o, String name)

Source from the content-addressed store, hash-verified

60 }
61
62 protected Object primitiveGet(ExecutionContext context, JSObject o, String name) {
63 // 8.7.1 primitive [[Get]]
64 Object d = o.getProperty(context, name, false);
65 if (d == Types.UNDEFINED) {
66 return Types.UNDEFINED;
67 }
68
69 PropertyDescriptor desc = (PropertyDescriptor) d;
70 if (desc.isDataDescriptor()) {
71 Object value = desc.getValue();
72 if ( value == null ) {
73 value = Types.UNDEFINED;
74 }
75 return value;
76 }
77
78 Object getter = desc.getGetter();
79
80 if (getter == Types.UNDEFINED) {
81 return Types.UNDEFINED;
82 }
83
84 return context.call((JSFunction) getter, o);
85 }
86
87 public void putValue(ExecutionContext context, Object value) {
88 // 8.7.2

Callers 1

getValueMethod · 0.95

Calls 5

isDataDescriptorMethod · 0.95
getValueMethod · 0.95
getGetterMethod · 0.95
getPropertyMethod · 0.65
callMethod · 0.65

Tested by

no test coverage detected