Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inherits-ex

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inherits-ex - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

test/isInheritedFrom-test.coffee

4

lib/inherits.js

@@ -26,5 +26,5 @@ var isArray = Array.isArray;

var result = false;
if (!isInheritedFrom(ctor, superCtor)) {
if (!isInheritedFrom(ctor, superCtor) && !isInheritedFrom(superCtor, ctor)) {
inheritsDirectly(ctor, superCtor);
while (v != null && (superCtor !== v)) {
while (v != null && superCtor !== v) {
ctor = superCtor;

@@ -31,0 +31,0 @@ superCtor = v;

@@ -5,2 +5,8 @@ var isInheritedFromStr = require('./isInheritedFromStr');

if ('string' === typeof superCtor) return isInheritedFromStr(ctor, superCtor, throwError);
if (ctor === superCtor) {
if (throwError)
throw new Error("Circular inherits found!");
else
return true;
}
var result = ctor.super_ === superCtor;

@@ -7,0 +13,0 @@ var checkeds = [];

module.exports = function(ctor, superStr, throwError) {
if (ctor.name === superStr) {
if (throwError)
throw new Error("Circular inherits found!");
else
return true;
}
var result = ctor.super_ != null && ctor.super_.name === superStr;

@@ -3,0 +9,0 @@ var checkeds = [];

@@ -79,3 +79,3 @@ var inherits = require('./inherits');

var result = false;
if (!isMixinedFrom(ctor, superCtor) && !isInheritedFrom(ctor, superCtor)) {
if (!isMixinedFrom(ctor, superCtor) && !isInheritedFrom(ctor, superCtor) && !isInheritedFrom(superCtor, ctor)) {
var mixinCtor = ctor.mixinCtor_;

@@ -90,5 +90,3 @@ var mixinCtors = ctor.mixinCtors_;

clonePrototype(mixinCtor, superCtor);
ctor.super_ = mixinCtor;
ctor.__super__ = mixinCtor.prototype; //for coffeeScirpt super keyword.
ctor.prototype = newPrototype(mixinCtor, ctor);
inheritsDirectly(ctor, mixinCtor);
result = true;

@@ -95,0 +93,0 @@ }

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/snowyu/inherits-ex.js",
"version": "1.0.1",
"version": "1.0.2",
"author": {

@@ -8,0 +8,0 @@ "name": "Riceball LEE",

@@ -26,5 +26,5 @@ var isArray = Array.isArray;

var result = false;
if (!isInheritedFrom(ctor, superCtor)) {
if (!isInheritedFrom(ctor, superCtor) && !isInheritedFrom(superCtor, ctor)) {
inheritsDirectly(ctor, superCtor);
while (v != null && (superCtor !== v)) {
while (v != null && superCtor !== v) {
ctor = superCtor;

@@ -31,0 +31,0 @@ superCtor = v;

@@ -5,2 +5,8 @@ var isInheritedFromStr = require('./isInheritedFromStr');

if ('string' === typeof superCtor) return isInheritedFromStr(ctor, superCtor, throwError);
if (ctor === superCtor) {
if (throwError)
throw new Error("Circular inherits found!");
else
return true;
}
var result = ctor.super_ === superCtor;

@@ -7,0 +13,0 @@ var checkeds = [];

module.exports = function(ctor, superStr, throwError) {
if (ctor.name === superStr) {
if (throwError)
throw new Error("Circular inherits found!");
else
return true;
}
var result = ctor.super_ != null && ctor.super_.name === superStr;

@@ -3,0 +9,0 @@ var checkeds = [];

@@ -79,3 +79,3 @@ var inherits = require('./inherits');

var result = false;
if (!isMixinedFrom(ctor, superCtor) && !isInheritedFrom(ctor, superCtor)) {
if (!isMixinedFrom(ctor, superCtor) && !isInheritedFrom(ctor, superCtor) && !isInheritedFrom(superCtor, ctor)) {
var mixinCtor = ctor.mixinCtor_;

@@ -90,5 +90,3 @@ var mixinCtors = ctor.mixinCtors_;

clonePrototype(mixinCtor, superCtor);
ctor.super_ = mixinCtor;
ctor.__super__ = mixinCtor.prototype; //for coffeeScirpt super keyword.
ctor.prototype = newPrototype(mixinCtor, ctor);
inheritsDirectly(ctor, mixinCtor);
result = true;

@@ -95,0 +93,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc