Search in sources :

Example 81 with OrdinaryObject

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;
}
Also used : OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) RegExpObject(com.github.anba.es6draft.runtime.objects.text.RegExpObject) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ArrayObject(com.github.anba.es6draft.runtime.types.builtins.ArrayObject)

Example 82 with OrdinaryObject

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;
}
Also used : OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) RegExpObject(com.github.anba.es6draft.runtime.objects.text.RegExpObject) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ArrayObject(com.github.anba.es6draft.runtime.types.builtins.ArrayObject)

Example 83 with OrdinaryObject

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;
}
Also used : OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) Property(com.github.anba.es6draft.runtime.types.Property)

Example 84 with OrdinaryObject

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;
}
Also used : OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) RegExpObject(com.github.anba.es6draft.runtime.objects.text.RegExpObject) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ArrayObject(com.github.anba.es6draft.runtime.types.builtins.ArrayObject)

Example 85 with OrdinaryObject

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;
}
Also used : OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ScriptObject(com.github.anba.es6draft.runtime.types.ScriptObject) RegExpObject(com.github.anba.es6draft.runtime.objects.text.RegExpObject) OrdinaryObject(com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject) ArrayObject(com.github.anba.es6draft.runtime.types.builtins.ArrayObject)

Aggregations

OrdinaryObject (com.github.anba.es6draft.runtime.types.builtins.OrdinaryObject)141 ArrayObject (com.github.anba.es6draft.runtime.types.builtins.ArrayObject)102 ScriptObject (com.github.anba.es6draft.runtime.types.ScriptObject)98 RegExpObject (com.github.anba.es6draft.runtime.objects.text.RegExpObject)84 Intrinsics (com.github.anba.es6draft.runtime.types.Intrinsics)14 Property (com.github.anba.es6draft.runtime.types.Property)5 CompilationException (com.github.anba.es6draft.compiler.CompilationException)3 ParserException (com.github.anba.es6draft.parser.ParserException)3 GlobalEnvironmentRecord (com.github.anba.es6draft.runtime.GlobalEnvironmentRecord)3 RuntimeInfo (com.github.anba.es6draft.runtime.internal.RuntimeInfo)3 ScriptLoader (com.github.anba.es6draft.runtime.internal.ScriptLoader)3 Source (com.github.anba.es6draft.runtime.internal.Source)3 FunctionConstructor.functionSource (com.github.anba.es6draft.runtime.objects.FunctionConstructor.functionSource)3 AsyncGeneratorFunctionConstructor (com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorFunctionConstructor)3 AsyncGeneratorFunctionPrototype (com.github.anba.es6draft.runtime.objects.async.iteration.AsyncGeneratorFunctionPrototype)3 AtomicsObject (com.github.anba.es6draft.runtime.objects.atomics.AtomicsObject)3 IntlObject (com.github.anba.es6draft.runtime.objects.intl.IntlObject)3 ArrayList (java.util.ArrayList)3 MethodCode (com.github.anba.es6draft.compiler.assembler.Code.MethodCode)2 MethodName (com.github.anba.es6draft.compiler.assembler.MethodName)2