#include "import.h"
#include "abc.h"
#include "registry.h"
+#include "common.h"
+#include "common.h"
#include "tokenizer.h"
#include "../os.h"
tag = tag->next;
}
+ tag = swf->firstTag;
/* pass 2 */
while(tag) {
if(tag->id == ST_DOABC || tag->id == ST_RAWABC) {
c->flags |= FLAG_DYNAMIC;
}
return;
- }
+ }
for(t=0;t<abc->classes->num;t++) {
abc_class_t*cls = array_getvalue(abc->classes, t);
trait_list_t*l=0;
char is_static = 0;
l = cls->traits;
+ if(!l) {
+ l = cls->static_traits;
+ is_static = 1;
+ }
while(l) {
trait_t*trait = l->trait;
U8 access = trait->name->ns->access;
trait->kind == TRAIT_GETTER) {
s = (memberinfo_t*)varinfo_register_onclass(c, access, ns, name);
s->type = resolve_class(filename, "type", trait->type_name);
+#if 0 // some variables are apparently both a static const and a slot
+ // needs split of static/non-static first
+ } else if(trait->kind == TRAIT_CONST) {
+ varinfo_t*v = (varinfo_t*)varinfo_register_onclass(c, access, ns, name);
+ v->type = resolve_class(filename, "type", trait->type_name);
+ v->flags |= FLAG_CONST;
+ /* leave this alone for now- it blows up the file too much
+ v->value = constant_clone(trait->value);*/
+ s = (memberinfo_t*)v;
+#endif
} else {
goto cont;
}
m = (memberinfo_t*)methodinfo_register_global(access, package, name);
m->return_type = resolve_class(filename, "return type", trait->method->return_type);
} else {
- m = (memberinfo_t*)varinfo_register_global(access, package, name);
- m->type = resolve_class(filename, "type", trait->type_name);
+ varinfo_t*v = varinfo_register_global(access, package, name);
+ v->type = resolve_class(filename, "type", trait->type_name);
+ v->value = constant_clone(trait->value);
+ v->flags |= trait->kind==TRAIT_CONST?FLAG_CONST:0;
+ m = (memberinfo_t*)v;
}
m->flags |= FLAG_BUILTIN;
m->parent = 0;