From bff4fa45c43a10e0d65f348235cc76b8746750ce Mon Sep 17 00:00:00 2001 From: ben hockey Date: Thu, 29 Dec 2011 15:57:01 -0500 Subject: [PATCH] facets: use prototype from appliesTo if schema does not provide one possibly fixes #21 --- facet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facet.js b/facet.js index cb1f10b..0ddb25e 100644 --- a/facet.js +++ b/facet.js @@ -694,7 +694,7 @@ exports.Permissive = function(appliesTo, schema){ schema = schema || {quality:0.5}; var appliesToPrototype = appliesTo.prototype; if(appliesToPrototype){ - var schemaPrototype = schema.prototype = schema.prototype || {}; + var schemaPrototype = schema.prototype = schema.prototype || appliesToPrototype; schemaPrototype.__noSuchMethod__ = function(name, source, args, onlyIfAvailable){ if(appliesToPrototype[name]){ return facet.wrap(appliesToPrototype[name].apply(source, args));