use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(VariableDeclaration node, Void value) {
Object id = node.getBinding().accept(this, value);
Object init = acceptOrNull(node.getInitializer(), value);
if (hasBuilder(Type.VariableDeclarator)) {
return call(Type.VariableDeclarator, node, id, init);
}
OrdinaryObject declarator = createNode(node, Type.VariableDeclarator);
addProperty(declarator, "id", id);
addProperty(declarator, "init", init);
return declarator;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(ExpressionStatement node, Void value) {
Object expression = node.getExpression().accept(this, value);
if (hasBuilder(Type.ExpressionStatement)) {
return call(Type.ExpressionStatement, node, expression);
}
OrdinaryObject statement = createStatement(node, Type.ExpressionStatement);
addProperty(statement, "expression", expression);
return statement;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method createPosition.
private OrdinaryObject createPosition(int line, int column) {
// subtract one to make columns 0-indexed
OrdinaryObject pos = createEmptyNode();
addProperty(pos, "line", line);
addProperty(pos, "column", column - 1);
return pos;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(SpreadElement node, Void value) {
Object expr = node.getExpression().accept(this, value);
if (hasBuilder(Type.SpreadExpression)) {
return call(Type.SpreadExpression, node, expr);
}
OrdinaryObject expression = createExpression(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(ArrayLiteral node, Void value) {
ArrayObject elements = createList(node.getElements(), value);
if (hasBuilder(Type.ArrayExpression)) {
return call(Type.ArrayExpression, node, elements);
}
OrdinaryObject expression = createExpression(node, Type.ArrayExpression);
addProperty(expression, "elements", elements);
return expression;
}
Aggregations