package com.drawbridge.jsengine.ast;
import java.util.LinkedList;
import com.drawbridge.jsengine.Scope;
import com.drawbridge.jsengine.jsobjects.ExecutionException;
import com.drawbridge.jsengine.jsobjects.JSType;
import com.drawbridge.jsengine.jsobjects.JSValueProperty;
import com.drawbridge.utils.Utils;
import com.google.caja.parser.js.ValueProperty;
public class ValuePropertyEvaluator extends Evaluator
{
String name;
public ValuePropertyEvaluator(Evaluator parent, Scope scope, ValueProperty valueProperty) {
super(parent,scope, valueProperty.getFilePosition());
name = valueProperty.getPropertyName();
mChildren.add(Evaluator.getEvaluator(this, scope, valueProperty.children().get(1)));
}
@Override
public JSType evaluate() throws EvaluatorException, ExecutionException
{
Utils.out.println(this.getClass(),"Value name" + mChildren.get(0).getClass().getName());
return new JSValueProperty(name, mChildren.get(0).evaluate());
}
@Override
public LinkedList<com.drawbridge.vl.blocks.Block> getBlocks()
{
return new LinkedList<com.drawbridge.vl.blocks.Block>();
}
}