use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(NewTarget node, Void value) {
// TODO: Attach location information.
Object meta = createIdentifier("new");
Object property = createIdentifier("target");
if (hasBuilder(Type.MetaProperty)) {
return call(Type.MetaProperty, node, meta, property);
}
OrdinaryObject expression = createExpression(node, Type.MetaProperty);
addProperty(expression, "meta", meta);
addProperty(expression, "property", property);
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(NativeCallExpression node, Void value) {
Object callee = node.getBase().accept(this, value);
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);
addProperty(expression, "native", true);
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(NewExpression node, Void value) {
Object callee = node.getExpression().accept(this, value);
ArrayObject arguments = createList(node.getArguments(), value);
if (hasBuilder(Type.NewExpression)) {
return call(Type.NewExpression, node, callee, arguments);
}
OrdinaryObject expression = createExpression(node, Type.NewExpression);
addProperty(expression, "callee", callee);
addProperty(expression, "arguments", arguments);
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(VariableStatement node, Void value) {
ArrayObject declarations = createList(node.getElements(), value);
String kind = "var";
if (hasBuilder(Type.VariableDeclaration)) {
return call(Type.VariableDeclaration, node, kind, declarations);
}
OrdinaryObject declaration = createDeclaration(node, Type.VariableDeclaration);
addProperty(declaration, "declarations", declarations);
addProperty(declaration, "kind", kind);
return declaration;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(AssignmentRestElement node, Void value) {
Object expr = node.getTarget().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;
}
Aggregations