Skip to content
Browse files

Apply missing interface bindings.

  • Loading branch information...
1 parent 30d4b01 commit a05e8c70034f37514f05a53460a4344bd6c51008 @mbebenita mbebenita committed Apr 6, 2013
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/avm2/runtime.js
View
14 src/avm2/runtime.js
@@ -1258,9 +1258,7 @@ var Runtime = (function () {
applyProtectedTraits(cls);
}
- if (ii.interfaces.length > 0) {
- cls.implementedInterfaces = [];
- }
+ cls.implementedInterfaces = [];
// Apply interface traits recursively.
//
@@ -1291,7 +1289,7 @@ var Runtime = (function () {
// IB$bar -> public$bar
//
// Luckily, interface methods are always public.
- (function applyInterfaceTraits(interfaces) {
+ function applyInterfaceTraits(interfaces) {
for (var i = 0, j = interfaces.length; i < j; i++) {
var interface = domain.getProperty(interfaces[i], true, true);
var ii = interface.classInfo.instanceInfo;
@@ -1318,7 +1316,13 @@ var Runtime = (function () {
defineNonEnumerableGetter(bindings, interfaceTraitQn, getter);
}
}
- })(ii.interfaces);
+ }
+ // Apply traits of all interfaces along the inheritance chain.
+ var tmp = cls;
+ while (tmp) {
+ applyInterfaceTraits(tmp.classInfo.instanceInfo.interfaces);
+ tmp = tmp.baseClass;
+ }
// Run the static initializer.
this.createFunction(classInfo.init, scope).call(cls);

0 comments on commit a05e8c7

Please sign in to comment.
Something went wrong with that request. Please try again.