From 7018dd7600e453deabb41253a790ec01b376a54b Mon Sep 17 00:00:00 2001 From: kramm Date: Tue, 30 Dec 2008 22:59:27 +0000 Subject: [PATCH 1/1] simplified new() for local classes --- lib/as3/parser.y | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/as3/parser.y b/lib/as3/parser.y index 08900d1..e46cded 100644 --- a/lib/as3/parser.y +++ b/lib/as3/parser.y @@ -1505,8 +1505,12 @@ NEW : "new" CLASS MAYBE_PARAM_VALUES { MULTINAME(m, $2); $$.c = code_new(); - /* TODO: why do we have to *find* our own classes? */ - $$.c = abc_findpropstrict2($$.c, &m); + if($2->slot) { + $$.c = abc_getglobalscope($$.c); + $$.c = abc_getslot($$.c, $2->slot); + } else { + $$.c = abc_findpropstrict2($$.c, &m); + } typedcode_list_t*l = $3; int len = 0; @@ -1515,7 +1519,10 @@ NEW : "new" CLASS MAYBE_PARAM_VALUES { l = l->next; len ++; } - $$.c = abc_constructprop2($$.c, &m, len); + if($2->slot) + $$.c = abc_construct($$.c, len); + else + $$.c = abc_constructprop2($$.c, &m, len); $$.t = $2; } -- 1.7.10.4