Created
June 16, 2017 17:43
-
-
Save tobie/17043c4b9ce27226dca37f08a2534d4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function traverse_inherited_and_consequential_interfaces(stack, callback) { | |
var I = stack.pop(); | |
callback(I); | |
I.array["implements"][I.name].forEach(id => { | |
var mixin = I.array.members[id]; | |
if (!mixin) { | |
throw new Error("Interface " + id + " not found (implemented by " + I.name + ")"); | |
} | |
var interfaces = mixin.get_inheritance_stack(); | |
traverse_inherited_and_consequential_interfaces(interfaces, callback); | |
}); | |
if (stack.length > 0) { | |
traverse_inherited_and_consequential_interfaces(stack, callback); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment