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

Method getValue

src/main/java/org/dynjs/runtime/Reference.java:42–60  ·  view source on GitHub ↗
(ExecutionContext context)

Source from the content-addressed store, hash-verified

40 }
41
42 public Object getValue(ExecutionContext context) {
43 // 8.7.1
44 Object value = null;
45 if (isUnresolvableReference()) {
46 throw new ThrowException(context, context.createReferenceError(referencedName + " is not defined"));
47 }
48
49 if (isPropertyReference()) {
50 if (!hasPrimitiveBase()) {
51 value = ((JSObject) this.base).get(context, this.referencedName);
52 } else {
53 value = primitiveGet(context, Types.toObject(context, this.base), this.referencedName);
54 }
55 } else {
56 value = ((EnvironmentRecord) this.base).getBindingValue(context, this.referencedName, this.strict);
57 }
58
59 return value;
60 }
61
62 protected Object primitiveGet(ExecutionContext context, JSObject o, String name) {
63 // 8.7.1 primitive [[Get]]

Callers 15

evalLinesMethod · 0.95
checkMethod · 0.95
assertNullMethod · 0.95
assertUndefinedMethod · 0.95

Calls 8

isPropertyReferenceMethod · 0.95
hasPrimitiveBaseMethod · 0.95
primitiveGetMethod · 0.95
toObjectMethod · 0.95
createReferenceErrorMethod · 0.80
getMethod · 0.65
getBindingValueMethod · 0.65

Tested by 15

evalLinesMethod · 0.76
checkMethod · 0.76
assertNullMethod · 0.76
assertUndefinedMethod · 0.76