use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(ArrayAssignmentPattern node, Void value) {
ArrayObject elements = createList(node.getElements(), value);
if (hasBuilder(Type.ArrayPattern)) {
return call(Type.ArrayPattern, node, elements);
}
OrdinaryObject pattern = createPattern(node, Type.ArrayPattern);
addProperty(pattern, "elements", elements);
return pattern;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method createLiteral.
private Object createLiteral(Expression node, Object value) {
if (hasBuilder(Type.Literal)) {
return call(Type.Literal, node, value);
}
OrdinaryObject literal = createExpression(node, Type.Literal);
addProperty(literal, "value", value);
return literal;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(BindingRestElement node, Void value) {
Object expr = node.getBinding().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(FunctionExpression node, Void value) {
Object id = acceptOrNull(node.getIdentifier(), value);
ArrayObject params = createList(getParameterBindings(node.getParameters()), value);
ArrayObject defaults = createListWithNull(getParameterDefaults(node.getParameters()), value);
Object rest = acceptOrNull(getRestParameter(node.getParameters()), value);
Object body = createFunctionBody(node, value);
boolean generator = false;
boolean expression = false;
if (hasBuilder(Type.FunctionExpression)) {
return call(Type.FunctionExpression, node, id, params, body, generator, expression);
}
OrdinaryObject function = createFunction(node, Type.FunctionExpression);
addProperty(function, "id", id);
addProperty(function, "params", params);
addProperty(function, "defaults", defaults);
addProperty(function, "body", body);
addProperty(function, "rest", rest);
addProperty(function, "generator", generator);
addProperty(function, "expression", expression);
return function;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(SuperCallExpression node, Void value) {
Object callee = superNode(node);
ArrayObject arguments = createList(node.getArguments(), value);
if (hasBuilder(Type.CallExpression)) {
return call(Type.CallExpression, node, callee, arguments);
}
OrdinaryObject expression = createExpression(node, Type.CallExpression);
addProperty(expression, "callee", callee);
addProperty(expression, "arguments", arguments);
return expression;
}
Aggregations