Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
weepy committed Apr 10, 2012
1 parent 7f16462 commit 8664323
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions o_O.js
Expand Up @@ -747,16 +747,15 @@ function ctor(){};

function inherits(parent, protoProps, staticProps) {

function construct(a, b) {
if(this instanceof construct)
var child = function(a, b) {
if(this instanceof child)
parent.apply(this, arguments)
else
return new construct(a, b)
return new child(a, b)
};

var child = protoProps && protoProps.hasOwnProperty('constructor')
? protoProps.constructor
: construct
if(protoProps && protoProps.hasOwnProperty('constructor'))
child = protoProps.constructor

extend(child, parent)
ctor.prototype = parent.prototype
Expand Down

0 comments on commit 8664323

Please sign in to comment.