/** * Evaluates the expression. * * @param env the calling environment. * @return the expression value. */ @Override public Value evalCopy(Env env) { Value obj = env.getThis(); if (obj.isNull()) { return cannotUseThisError(env); } return obj.getThisField(env, _name).copy(); }
/** * Evaluates the expression. * * @param env the calling environment. * @return the expression value. */ @Override public void evalUnset(Env env) { Value obj = env.getThis(); if (obj.isNull()) { cannotUseThisError(env); } obj.unsetThisField(_name); }
/** * Evaluates the expression. * * @param env the calling environment. * @return the expression value. */ @Override public Value evalArg(Env env, boolean isTop) { Value obj = env.getThis(); if (obj.isNull()) { return cannotUseThisError(env); } return obj.getThisFieldArg(env, _name); }
/** * Evaluates the expression. * * @param env the calling environment. * @return the expression value. */ @Override public Value evalAssignRef(Env env, Value value) { Value obj = env.getThis(); if (obj.isNull()) { cannotUseThisError(env); } obj.putThisField(env, _name, value); return value; }
/** * Evaluates the expression. * * @param env the calling environment. * @return the expression value. */ @Override public Var evalVar(Env env) { Value obj = env.getThis(); if (obj.isNull()) { cannotUseThisError(env); return new Var(); } return obj.getThisFieldVar(env, _name); }
/** Evaluates as an array index assign ($a[index] = value). */ @Override public Value evalArrayAssign(Env env, Value index, Value value) { Value obj = env.getThis(); if (obj.isNull()) { cannotUseThisError(env); } Value fieldVar = obj.getThisFieldVar(env, _name); // php/03mm return fieldVar.put(index, value); }