diff --git a/lib/schema.js b/lib/schema.js index 4ec2379167a..27b97a91bf7 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -343,8 +343,11 @@ Schema.prototype.tree; */ Schema.prototype.clone = function() { - var s = Object.create(Schema.prototype); - utils.merge(s, this, { retainKeyOrder: true, hasOwnProperty: true }); + var s = new Schema(this.obj, this.options); + // Clone the call queue + s.callQueue = this.callQueue.map(function(f) { return f; }); + s.methods = utils.clone(this.methods); + s.statics = utils.clone(this.statics); return s; };