From 8664323fd752cd65e9fe548d83d3128efd9e0e77 Mon Sep 17 00:00:00 2001 From: weepy Date: Tue, 10 Apr 2012 21:49:59 +0100 Subject: [PATCH] tweak --- o_O.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/o_O.js b/o_O.js index 832e745..4b2627d 100644 --- a/o_O.js +++ b/o_O.js @@ -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