use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(ArrayComprehension node, Void value) {
// Comprehension/LegacyComprehension already created a partial result
OrdinaryObject expression = (OrdinaryObject) node.getComprehension().accept(this, value);
if (hasBuilder(Type.ComprehensionExpression)) {
Object body = Get(cx, expression, "body");
Object blocks = Get(cx, expression, "blocks");
Object filter = Get(cx, expression, "filter");
return call(Type.ComprehensionExpression, node, body, blocks, filter);
}
addNodeInfo(expression, node, Type.ComprehensionExpression);
return expression;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(SpreadProperty node, Void value) {
Object expr = node.getExpression().accept(this, value);
if (hasBuilder(Type.SpreadExpression)) {
return call(Type.SpreadExpression, node, expr);
}
OrdinaryObject expression = createNode(node, Type.SpreadExpression);
addProperty(expression, "expression", expr);
return expression;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(Script node, Void value) {
ArrayObject body = createList(node.getStatements(), value);
if (hasBuilder(Type.Program)) {
return call(Type.Program, node, body);
}
OrdinaryObject program = createNode(node, Type.Program);
addProperty(program, "body", body);
addProperty(program, "sourceType", "script");
return program;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(LetExpression node, Void value) {
ArrayObject head = createList(node.getBindings(), value);
Object body = node.getExpression().accept(this, value);
if (hasBuilder(Type.LetExpression)) {
return call(Type.LetExpression, node, head, body);
}
OrdinaryObject expression = createExpression(node, Type.LetExpression);
addProperty(expression, "head", head);
addProperty(expression, "body", body);
return expression;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(ForInStatement node, Void value) {
Object forInStatement;
Object left = node.getHead().accept(this, value);
Object right = node.getExpression().accept(this, value);
Object body = node.getStatement().accept(this, value);
boolean each = false;
if (hasBuilder(Type.ForInStatement)) {
forInStatement = call(Type.ForInStatement, node, left, right, body, each);
} else {
OrdinaryObject statement = createStatement(node, Type.ForInStatement);
addProperty(statement, "left", left);
addProperty(statement, "right", right);
addProperty(statement, "body", body);
addProperty(statement, "each", each);
forInStatement = statement;
}
return createLabelledStatement(node, forInStatement);
}
Aggregations