From 2703b804011528e0cae57cde3a8956dc69464d88 Mon Sep 17 00:00:00 2001 From: Boris Staal Date: Sun, 10 Nov 2013 12:36:19 +0700 Subject: [PATCH] Mixins included into inheritance chain --- lib/entities/class.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/entities/class.coffee b/lib/entities/class.coffee index faa9288..e28a31e 100644 --- a/lib/entities/class.coffee +++ b/lib/entities/class.coffee @@ -162,6 +162,14 @@ module.exports = class Entities.Class extends require('../entity') @_effectiveMethods + allMethods: -> + methods = @effectiveMethods() + methods = methods.concat mixin.effectiveInclusionMethods() for mixin in @includes + methods = methods.concat mixin.effectiveExtensionMethods() for mixin in @extends + methods = methods.concat mixin.effectiveConcernMethods() for mixin in @concerns + + methods + inherited: (getter) -> return [] if !@parent || !@parent.name? @@ -173,7 +181,7 @@ module.exports = class Entities.Class extends require('../entity') inheritedMethods: -> @_inheritedMethods ||= @inherited => - @parent.effectiveMethods().concat(@parent.inheritedMethods()) + @parent.allMethods().concat(@parent.inheritedMethods()) inheritedVariables: -> @_inheritedVariables ||= @inherited =>