RelationalExpression : RelationalExpression in ShiftExpression
function evaluate(RelationalExpression in ShiftExpression) {
var lref = evaluate(RelationalExpression);
var lval = GetValue(lref);
var rref = evaluate(ShiftExpression);
var rval = GetValue(rref);
if (Type(rval) != 'object') throw TypeError;
return rval.[[HasProperty]](ToString(lval));
}
Note that the left operand is converted to String before checking whether it exists.
This operator is the cause of a lot of duplicate Productions. Very annoying. But it was required to make the distinction with the for statement.