Comparing version 1.0.0 to 1.0.1
20
index.js
var exports = {}; | ||
exports.Inherit = function (type, base) { | ||
exports.abstract = function (type) { | ||
var old = type; | ||
type = (function () { | ||
var old = this.old, base = this.base; | ||
var old = this.old; | ||
return function () { | ||
base.apply(this, arguments); | ||
if (this.constructor == old) | ||
throw Error(type.name + " instance can not be created!"); | ||
old.apply(this, arguments); | ||
} | ||
}).call({ old: old, base: base }); | ||
}).call({ old: old }); | ||
type.prototype = old.prototype; | ||
type.prototype.__proto__ = base.prototype; | ||
Object.defineProperty(type, "name", { value: old.name }); | ||
@@ -18,13 +18,13 @@ return type; | ||
exports.Abstract = function (type) { | ||
exports.inherit = function (type, base) { | ||
var old = type; | ||
type = (function () { | ||
var old = this.old; | ||
var old = this.old, base = this.base; | ||
return function () { | ||
if (this.constructor == old) | ||
throw Error(type.name + " instance can not be created!"); | ||
base.apply(this, arguments); | ||
old.apply(this, arguments); | ||
} | ||
}).call({ old: old }); | ||
}).call({ old: old, base: base }); | ||
type.prototype = old.prototype; | ||
type.prototype.__proto__ = base.prototype; | ||
Object.defineProperty(type, "name", { value: old.name }); | ||
@@ -31,0 +31,0 @@ return type; |
{ | ||
"name": "jujsoop", | ||
"version": "1.0.0", | ||
"description": "", | ||
"version": "1.0.1", | ||
"description": "For inheritance in javascript.", | ||
"main": "index.js", | ||
@@ -10,3 +10,3 @@ "scripts": { | ||
"author": "josephuz", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"files": [ | ||
@@ -19,3 +19,8 @@ "package.json", | ||
"url": "https://github.com/JosephUz/juJsOop.git" | ||
} | ||
}, | ||
"keywords":[ | ||
"OOP", | ||
"Javascript OOP", | ||
"Inheritance" | ||
] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3611
4
70