use of com.github.anba.es6draft.runtime.types.builtins.ArrayObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(CommaExpression node, Void value) {
ArrayObject expressions = createList(node.getOperands(), value);
if (hasBuilder(Type.SequenceExpression)) {
return call(Type.SequenceExpression, node, expressions);
}
OrdinaryObject expression = createExpression(node, Type.SequenceExpression);
addProperty(expression, "expressions", expressions);
return expression;
}
use of com.github.anba.es6draft.runtime.types.builtins.ArrayObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(FunctionDeclaration 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.FunctionDeclaration)) {
return call(Type.FunctionDeclaration, node, id, params, body, generator, expression);
}
OrdinaryObject function = createFunction(node, Type.FunctionDeclaration);
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.ArrayObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(AsyncFunctionExpression 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);
// TODO: flag for async
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.ArrayObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(AsyncGeneratorExpression 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);
// TODO: flag for async generator
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.ArrayObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(BlockStatement node, Void value) {
ArrayObject body = createList(node.getStatements(), value);
if (hasBuilder(Type.BlockStatement)) {
return call(Type.BlockStatement, node, body);
}
OrdinaryObject statement = createStatement(node, Type.BlockStatement);
addProperty(statement, "body", body);
return statement;
}
Aggregations