6 void initcode_add_classlist(abc_script_t*init, parsedclass_list_t*classes)
10 c = abc_getlocal_0(c);
13 for(;classes;classes=classes->next) {
14 abc_class_t*abc = classes->parsedclass->abc;
15 classinfo_t*cls = classes->parsedclass->cls;
17 /* write the construction code for this class to the global init
19 MULTINAME(classname2,cls);
20 int slotindex = abc_initscript_addClassTrait(init, &classname2, abc);
22 c = abc_getglobalscope(c);
23 classinfo_t*s = cls->superclass;
28 //TODO: take a look at the current scope stack, maybe
29 // we can re-use something
34 multiname_t*s2 = sig2mname(s);
35 c = abc_getlex2(c, s2);
36 multiname_destroy(s2);
38 c = abc_pushscope(c); count++;
39 c = c->prev->prev; // invert
41 /* continue appending after last op end */
42 while(c && c->next) c = c->next;
44 multiname_t*extends2 = sig2mname(cls->superclass);
45 /* TODO: if this is one of *our* classes, we can also
46 do a getglobalscope/getslot <nr> (which references
47 the init function's slots) */
49 c = abc_getlex2(c, extends2);
51 /* notice: we get a Verify Error #1107 if the top elemnt on the scope
52 stack is not the superclass */
53 c = abc_pushscope(c);count++;
56 /* notice: we get a verify error #1107 if the top element on the scope
57 stack is not the global object */
58 c = abc_getlocal_0(c);
59 c = abc_pushscope(c);count++;
61 c = abc_newclass(c,abc);
65 c = abc_setslot(c, slotindex);
66 multiname_destroy(extends2);
68 c = abc_returnvoid(c);
70 init->method->body->code = c;