use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(YieldExpression node, Void value) {
Object argument = acceptOrNull(node.getExpression(), value);
boolean delegate = node.isDelegatedYield();
if (hasBuilder(Type.YieldExpression)) {
return call(Type.YieldExpression, node, argument, delegate);
}
OrdinaryObject expression = createExpression(node, Type.YieldExpression);
addProperty(expression, "argument", argument);
addProperty(expression, "delegate", delegate);
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(CatchNode node, Void value) {
Object param = node.getCatchParameter().accept(this, value);
Object guard = NULL;
Object body = node.getCatchBlock().accept(this, value);
if (hasBuilder(Type.CatchClause)) {
return call(Type.CatchClause, node, param, guard, body);
}
OrdinaryObject catchClause = createNode(node, Type.CatchClause);
addProperty(catchClause, "param", param);
addProperty(catchClause, "guard", guard);
addProperty(catchClause, "body", body);
return catchClause;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class RegExpPrototype method isBuiltinRegExpPrototypeForExec.
private static boolean isBuiltinRegExpPrototypeForExec(ExecutionContext cx) {
OrdinaryObject prototype = cx.getIntrinsic(Intrinsics.RegExpPrototype);
Property execProp = prototype.getOwnProperty(cx, "exec");
if (execProp == null || !isBuiltinExec(cx.getRealm(), execProp.getValue())) {
return false;
}
Property globalProp = prototype.getOwnProperty(cx, "global");
if (globalProp == null || !isBuiltinGlobal(cx.getRealm(), globalProp.getGetter())) {
return false;
}
Property stickyProp = prototype.getOwnProperty(cx, "sticky");
if (stickyProp == null || !isBuiltinSticky(cx.getRealm(), stickyProp.getGetter())) {
return false;
}
return true;
}
use of com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject in project es6draft by anba.
the class ReflectParser method visit.
@Override
public Object visit(AssignmentExpression node, Void value) {
Object left = node.getLeft().accept(this, value);
Object right = node.getRight().accept(this, value);
String operator = node.getOperator().getName();
if (hasBuilder(Type.AssignmentExpression)) {
return call(Type.AssignmentExpression, node, operator, left, right);
}
OrdinaryObject expression = createExpression(node, Type.AssignmentExpression);
addProperty(expression, "left", left);
addProperty(expression, "right", right);
addProperty(expression, "operator", operator);
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(FunctionSent node, Void value) {
// TODO: Attach location information.
Object meta = createIdentifier("function");
Object property = createIdentifier("sent");
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;
}
Aggregations