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);
    }
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);
       
       
       
        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); 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); }