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

Method putValue

src/main/java/org/dynjs/runtime/Reference.java:87–104  ·  view source on GitHub ↗
(ExecutionContext context, Object value)

Source from the content-addressed store, hash-verified

85 }
86
87 public void putValue(ExecutionContext context, Object value) {
88 // 8.7.2
89 if (isUnresolvableReference()) {
90 if (isStrictReference()) {
91 throw new ThrowException(context, context.createReferenceError(referencedName + " is not defined"));
92 } else {
93 context.getGlobalContext().getObject().put(context, this.referencedName, value, false);
94 }
95 } else if (isPropertyReference()) {
96 if (!hasPrimitiveBase()) {
97 ((JSObject) this.base).put(context, this.referencedName, value, this.strict);
98 } else {
99 // TODO: handle primitives
100 }
101 } else {
102 ((EnvironmentRecord) this.base).setMutableBinding(context, this.referencedName, value, this.strict);
103 }
104 }
105
106 public boolean isValidForPrePostIncrementDecrement() {
107 if (isStrictReference() && getBase() instanceof EnvironmentRecord) {

Callers 10

interpretMethod · 0.95
interpretMethod · 0.95
interpretMethod · 0.95
visitMethod · 0.95
interpretMethod · 0.80
interpretMethod · 0.80
interpretMethod · 0.80
interpretMethod · 0.80
interpretMethod · 0.80
callMethod · 0.80

Calls 9

isStrictReferenceMethod · 0.95
isPropertyReferenceMethod · 0.95
hasPrimitiveBaseMethod · 0.95
createReferenceErrorMethod · 0.80
getObjectMethod · 0.80
putMethod · 0.65
getGlobalContextMethod · 0.65
setMutableBindingMethod · 0.65

Tested by

no test coverage detected