Search in sources :

Example 1 with MethodDefinition

use of com.github.anba.es6draft.ast.MethodDefinition in project es6draft by anba.

the class FunctionCodeGenerator method generateClassCall.

private void generateClassCall(ClassDefinition node) {
    MethodDefinition constructor = node.getConstructor();
    MethodDefinition callConstructor = node.getCallConstructor();
    MethodCode method = codegen.newMethod(constructor, FunctionName.Call);
    InstructionVisitor mv = new CallMethodGenerator(method, targetName(constructor), targetType(constructor));
    mv.lineInfo(callConstructor);
    mv.begin();
    generateFunctionCall(callConstructor, OrdinaryConstructorFunction.class, mv);
    mv.end();
}
Also used : MethodDefinition(com.github.anba.es6draft.ast.MethodDefinition) MethodCode(com.github.anba.es6draft.compiler.assembler.Code.MethodCode)

Example 2 with MethodDefinition

use of com.github.anba.es6draft.ast.MethodDefinition in project es6draft by anba.

the class FunctionCodeGenerator method generate.

void generate(ClassDefinition node, boolean tailCall, boolean tailConstruct) {
    MethodDefinition constructor = node.getConstructor();
    MethodDefinition callConstructor = node.getCallConstructor();
    if (callConstructor == null) {
        generateCall(constructor);
    } else {
        generateClassCall(node);
    }
    generateConstruct(constructor, tailConstruct);
}
Also used : MethodDefinition(com.github.anba.es6draft.ast.MethodDefinition)

Aggregations

MethodDefinition (com.github.anba.es6draft.ast.MethodDefinition)2 MethodCode (com.github.anba.es6draft.compiler.assembler.Code.MethodCode)1