internal void Merge(DoABC abc, SWFContext ctx)
{
/* Because we want everything to be object references... */
AbcCode abcCode = abc.Code; /* This is a kludge to force initial parsing of the abc data, if not done already */
AbcCode thisCode = this.Code;
abc.Disassemble(); /* This ensures that the code is disassembled into mergable form */
this.Disassemble();
foreach (AS3ClassDef clazz in abc.Code.Classes)
{
AS3ClassDef classCollision = thisCode.GetClassByQName(clazz.Name.QualifiedName);
if (classCollision != null)
{
throw new SWFModellerException(
SWFModellerError.CodeMerge,
"Class name collision on " + clazz.Name,
ctx.Sentinel("ClassNameCollision"));
}
thisCode.AddClass(clazz);
}
}