int index;
classinfo_t*type;
char init;
+ char is_parameter;
methodstate_t*is_inner_method;
} variable_t;
c = abc_getlocal_0(c);
c = abc_constructsuper(c, 0);
}
+
+ if(m->slots) {
+ /* all parameters that are used by inner functions
+ need to be copied from local to slot */
+ parserassert(m->activation_var);
+ DICT_ITERATE_ITEMS(m->slots,char*,name,variable_t*,v) {
+ if(v->is_parameter) {
+ c = abc_getlocal(c, m->activation_var);
+ c = abc_getlocal(c, v->index);
+ c = abc_setslot(c, v->index);
+ }
+ }
+ }
list_free(m->innerfunctions);
m->innerfunctions = 0;
return c;
if(params) {
param_list_t*p=0;
for(p=params->list;p;p=p->next) {
- new_variable(p->param->name, p->param->type, 0, 1);
+ variable_t*v = new_variable2(p->param->name, p->param->type, 0, 1);
+ v->is_parameter = 1;
}
}
+ if(m->uses_slots) {
+ dict_dump(m->slots, stdout, "");
+ }
methodstate_list_t*l = m->innerfunctions;
while(l) {
/* exchange unresolved identifiers with the actual objects */
DICT_ITERATE_ITEMS(m->slots, char*, name, variable_t*, v) {
if(v->type && v->type->kind == INFOTYPE_UNRESOLVED) {
- v->type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
- if(!v->type || v->type->kind != INFOTYPE_CLASS) {
- syntaxerror("Couldn't find class %s", v->type->name);
+ classinfo_t*type = (classinfo_t*)registry_resolve((slotinfo_t*)v->type);
+ if(!type || type->kind != INFOTYPE_CLASS) {
+ syntaxerror("Couldn't find class %s::%s (%s)", v->type->package, v->type->name, name);
}
+ v->type = type;
}
}
}
if(!s && as3_pass==1) {// || !(s->flags&FLAG_BUILTIN)) {
as3_schedule_class($2->package, $2->name);
}
-
- PASS2
classinfo_t*c = $2;
if(!c)
syntaxerror("Couldn't import class\n");
as3_schedule_package($2);
}
- PASS2
NEW(import_t,i);
i->package = $2;
state_has_imports();