// TODO This should be OP_returnvoid, but the Boolean default value
// for the 'returns' parameter isn't defaulting to true.
// Fix this after CMP-936 is fixed.
protected final void codegenCallInContextMethod(ClassGeneratorHelper classGen, boolean isOverride)
    {
        IResolvedQualifiersReference applyReference = ReferenceFactory.resolvedQualifierQualifiedReference(royaleProject.getWorkspace(), 
                NamespaceDefinition.getAS3NamespaceDefinition(), "apply");
        InstructionList callInContext = new InstructionList();
        callInContext.addInstruction(ABCConstants.OP_getlocal1);
        callInContext.addInstruction(ABCConstants.OP_getlocal2);
        callInContext.addInstruction(ABCConstants.OP_getlocal3);
        callInContext.addInstruction(ABCConstants.OP_callproperty, new Object[] {applyReference.getMName(), 2});
        callInContext.addInstruction(ABCConstants.OP_getlocal, 4);
        Label callInContextReturnVoid = new Label();
        callInContext.addInstruction(ABCConstants.OP_iffalse, callInContextReturnVoid);
        callInContext.addInstruction(ABCConstants.OP_returnvalue);
        callInContext.labelNext(callInContextReturnVoid);
        // TODO This should be OP_returnvoid, but the Boolean default value
        // for the 'returns' parameter isn't defaulting to true.
        // Fix this after CMP-936 is fixed.
        callInContext.addInstruction(ABCConstants.OP_returnvalue);
        ImmutableList<Name> callInContextParams = new ImmutableList.Builder<Name>()
                .add(new Name(IASLanguageConstants.Function))
                .add(new Name(IASLanguageConstants.Object))
                .add(new Name(IASLanguageConstants.Array))
                .add(new Name(IASLanguageConstants.Boolean))
                .build();
        classGen.addITraitsMethod(new Name("callInContext"), callInContextParams, null, 
                Collections.<Object> singletonList(Boolean.TRUE), false, true, isOverride, callInContext);
    }
callInContext.addInstruction(ABCConstants.OP_returnvalue);
callInContext.labelNext(callInContextReturnVoid);
// TODO This should be OP_returnvoid, but the Boolean default value
// for the 'returns' parameter isn't defaulting to true.
// Fix this after CMP-936 is fixed.
callInContext.addInstruction(ABCConstants.OP_returnvalue);
ImmutableList<Name> callInContextParams = new ImmutableList.Builder<Name>()
InstructionList callInContext = new InstructionList();
callInContext.addInstruction(ABCConstants.OP_getlocal1);
callInContext.addInstruction(ABCConstants.OP_getlocal2);
callInContext.addInstruction(ABCConstants.OP_getlocal3);
callInContext.addInstruction(ABCConstants.OP_callproperty, new Object[] {applyReference.getMName(), 2});
callInContext.addInstruction(ABCConstants.OP_getlocal, 4);
Label callInContextReturnVoid = new Label();
callInContext.addInstruction(ABCConstants.OP_iffalse, callInContextReturnVoid);
callInContext.addInstruction(ABCConstants.OP_returnvalue);
callInContext.labelNext(callInContextReturnVoid);
// TODO This should be OP_returnvoid, but the Boolean default value
// for the 'returns' parameter isn't defaulting to true.
// Fix this after CMP-936 is fixed.
callInContext.addInstruction(ABCConstants.OP_returnvalue);
ImmutableList<Name> callInContextParams = new ImmutableList.Builder<Name>()
.add(new Name(IASLanguageConstants.Function))
.add(new Name(IASLanguageConstants.Object))
.add(new Name(IASLanguageConstants.Array))
.add(new Name(IASLanguageConstants.Boolean))
.build();
classGen.addITraitsMethod(new Name("callInContext"), callInContextParams, null,
Collections.<Object> singletonList(Boolean.TRUE), false, true, isOverride, callInContext);
}
protected final void codegenCallInContextMethod(ClassGeneratorHelper classGen, boolean isOverride)
{
IResolvedQualifiersReference applyReference = ReferenceFactory.resolvedQualifierQualifiedReference(royaleProject.getWorkspace(),
NamespaceDefinition.getAS3NamespaceDefinition(), "apply");
InstructionList callInContext = new InstructionList();
callInContext.addInstruction(ABCConstants.OP_getlocal1);
callInContext.addInstruction(ABCConstants.OP_getlocal2);
callInContext.addInstruction(ABCConstants.OP_getlocal3);
callInContext.addInstruction(ABCConstants.OP_callproperty, new Object[] {applyReference.getMName(), 2});
callInContext.addInstruction(ABCConstants.OP_getlocal, 4);
Label callInContextReturnVoid = new Label();
callInContext.addInstruction(ABCConstants.OP_iffalse, callInContextReturnVoid);
callInContext.addInstruction(ABCConstants.OP_returnvalue);
callInContext.labelNext(callInContextReturnVoid);
// TODO This should be OP_returnvoid, but the Boolean default value
// for the 'returns' parameter isn't defaulting to true.
// Fix this after CMP-936 is fixed.
callInContext.addInstruction(ABCConstants.OP_returnvalue);
ImmutableList<Name> callInContextParams = new ImmutableList.Builder<Name>()
.add(new Name(IASLanguageConstants.Function))
.add(new Name(IASLanguageConstants.Object))
.add(new Name(IASLanguageConstants.Array))
.add(new Name(IASLanguageConstants.Boolean))
.build();
classGen.addITraitsMethod(new Name("callInContext"), callInContextParams, null,
Collections.<Object> singletonList(Boolean.TRUE), false, true, isOverride, callInContext);
}