Comparing version 0.0.8 to 1.0.0
26
index.js
@@ -1,2 +0,2 @@ | ||
;(function () { | ||
; (function () { | ||
var createInstance = (function () { | ||
@@ -13,3 +13,3 @@ var fnBody = ['switch(args.length){'] | ||
function getPropertyNames (obj) { | ||
function getPropertyNames(obj) { | ||
var nameList = Object.getOwnPropertyNames(obj) | ||
@@ -22,3 +22,13 @@ if (obj.__proto__) { | ||
function createSuper (_self, proto) { | ||
function isChildClass(_child, _super) { | ||
if (_child.__proto__ == _super.prototype) { | ||
return true | ||
} else if (_child.prototype) { | ||
return isChildClass(_child.prototype, _super) | ||
} else { | ||
return false | ||
} | ||
} | ||
function createSuper(_self, proto) { | ||
var _super = function () { | ||
@@ -48,3 +58,3 @@ if (proto.constructor) { | ||
function defineClass (def) { | ||
function defineClass(def) { | ||
var classProto = ((typeof def === 'function') ? def() : def) || {} | ||
@@ -67,3 +77,3 @@ var classExtends = classProto._extends | ||
Class.__proto__ = clsssStatic | ||
function Class () { | ||
function Class() { | ||
var instance = this | ||
@@ -84,2 +94,8 @@ if (typeof classExtends === 'function') { | ||
} | ||
Class.extendsOf = function (_super) { | ||
return isChildClass(this, _super) | ||
}; | ||
Class.superOf = function (_child) { | ||
return isChildClass(_child, this) | ||
}; | ||
return Class | ||
@@ -86,0 +102,0 @@ } |
{ | ||
"name": "cify", | ||
"version": "0.0.8", | ||
"version": "1.0.0", | ||
"description": "一个面向对象辅助模块", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5495
165
2