custom-ability
Advanced tools
Comparing version 1.4.0 to 1.4.1
(function() { | ||
'use strict'; | ||
var defineProperty, extend, extendFilter, getNonEnumNames, injectMethod, injectMethods, injectMethodsFromNonEnum, isArray, isBoolean, isFunction, | ||
var defineProperty, extend, extendFilter, getNonEnumNames, hasAbilityOnParent, injectMethod, injectMethods, injectMethodsFromNonEnum, isArray, isBoolean, isFunction, | ||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
@@ -24,2 +24,4 @@ | ||
hasAbilityOnParent = require('./has-ability-on-parent'); | ||
injectMethodsFromNonEnum = function(aTargetClass, aObject, filter) { | ||
@@ -50,3 +52,3 @@ var nonEnumNames, result; | ||
module.exports = function(abilityClass, aCoreMethod, isGetClassFunc) { | ||
var abilityFn, filter, getAdditionalAbility, hasAbilityOnParent, injectAdditionalAbility; | ||
var abilityFn, filter, getAdditionalAbility, injectAdditionalAbility; | ||
if (isBoolean(aCoreMethod)) { | ||
@@ -188,13 +190,2 @@ isGetClassFunc = aCoreMethod; | ||
}; | ||
hasAbilityOnParent = function(aClass, aName) { | ||
var result; | ||
result = false; | ||
while (!result && aClass && aClass.prototype) { | ||
if (aClass.prototype.hasOwnProperty('$abilities') && aClass.prototype.$abilities.hasOwnProperty('$' + aName)) { | ||
result = true; | ||
} | ||
aClass = aClass.super_; | ||
} | ||
return result; | ||
}; | ||
getAdditionalAbility = function(aClass, aName) { | ||
@@ -201,0 +192,0 @@ var result; |
{ | ||
"name": "custom-ability", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "make custom ability more easy. generate the ability which can be added to any class directly.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/snowyu/custom-ability.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
51723
18
253