diff options
author | Benjamin Otte <otte@gnome.org> | 2008-08-20 18:38:07 +0100 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2008-08-20 18:38:07 +0100 |
commit | 0d1d9b82b7313d5086b5982a3eb6a64fbf804bd6 (patch) | |
tree | fee81e8fca505159d9462731e551beb6fdf67b19 | |
parent | 4593adedbad0a5a2875f947350585354f6b3e13f (diff) |
make base scope chains work
-rw-r--r-- | swfdec/swfdec_abc_interpret.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/swfdec/swfdec_abc_interpret.c b/swfdec/swfdec_abc_interpret.c index 1a065dd4..af2d4b67 100644 --- a/swfdec/swfdec_abc_interpret.c +++ b/swfdec/swfdec_abc_interpret.c @@ -442,7 +442,6 @@ swfdec_abc_interpret_new_class (SwfdecAbcTraits *traits, SwfdecAbcClass *base, swfdec_as_context_throw_abc (context, SWFDEC_ABC_TYPE_VERIFY_ERROR, "The OP_newclass opcode was used with the incorrect base class."); } - chain->base = swfdec_abc_scope_chain_ref (base->instance_scope); } if (!swfdec_abc_traits_resolve (traits) || @@ -455,6 +454,8 @@ swfdec_abc_interpret_new_class (SwfdecAbcTraits *traits, SwfdecAbcClass *base, SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (classp)); /* add class to instance scope */ classp->instance_scope = swfdec_abc_scope_chain_new (context, chain, &val, &val + 1, &val + 1); + if (base) + classp->instance_scope->base = swfdec_abc_scope_chain_ref (base->instance_scope); if (classp->prototype) { if (base) @@ -474,6 +475,8 @@ swfdec_abc_interpret_new_class (SwfdecAbcTraits *traits, SwfdecAbcClass *base, } } else { SWFDEC_AS_OBJECT (classp)->prototype = SWFDEC_AS_OBJECT (SWFDEC_ABC_GET_CLASS_CLASS (context)->prototype); + if (chain) + chain->base = swfdec_abc_scope_chain_ref (SWFDEC_ABC_OBJECT (SWFDEC_ABC_GET_CLASS_CLASS (context))->scope); } /* required so Function init code can use newfunction */ if (itraits->name == SWFDEC_AS_STR_Function) { |