git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
dfcf7db
)
fixed bug in variable allocation
author
kramm
<kramm>
Fri, 2 Jan 2009 19:53:07 +0000
(19:53 +0000)
committer
kramm
<kramm>
Fri, 2 Jan 2009 19:53:07 +0000
(19:53 +0000)
lib/as3/parser.y
patch
|
blob
|
history
diff --git
a/lib/as3/parser.y
b/lib/as3/parser.y
index
9ed8e40
..
e678826
100644
(file)
--- a/
lib/as3/parser.y
+++ b/
lib/as3/parser.y
@@
-887,6
+887,7
@@
static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*n
syntaxerror("not able to start another method scope");
}
new_state();
syntaxerror("not able to start another method scope");
}
new_state();
+ global->variable_count = 0;
state->method = rfx_calloc(sizeof(methodstate_t));
state->method->initcode = 0;
state->method->has_super = 0;
state->method = rfx_calloc(sizeof(methodstate_t));
state->method->initcode = 0;
state->method->has_super = 0;
@@
-897,14
+898,11
@@
static void startfunction(token_t*ns, int flags, enum yytokentype getset, char*n
new_variable((flags&FLAG_STATIC)?"class":"this", state->cls->info, 0);
} else {
state->method->is_global = 1;
new_variable((flags&FLAG_STATIC)?"class":"this", state->cls->info, 0);
} else {
state->method->is_global = 1;
+ state->method->late_binding = 1; // for global methods, always push local_0 on the scope stack
+
new_variable("globalscope", 0, 0);
new_variable("globalscope", 0, 0);
-
- /* for global methods, always push local_0 on the scope stack: */
- state->method->late_binding = 1;
}
}
- global->variable_count = 0;
-
/* state->vars is initialized by state_new */
param_list_t*p=0;
/* state->vars is initialized by state_new */
param_list_t*p=0;