/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['base/proxy.js']) {
  _$jscoverage['base/proxy.js'] = [];
  _$jscoverage['base/proxy.js'][1] = 0;
  _$jscoverage['base/proxy.js'][3] = 0;
  _$jscoverage['base/proxy.js'][4] = 0;
  _$jscoverage['base/proxy.js'][6] = 0;
  _$jscoverage['base/proxy.js'][8] = 0;
  _$jscoverage['base/proxy.js'][9] = 0;
  _$jscoverage['base/proxy.js'][11] = 0;
  _$jscoverage['base/proxy.js'][14] = 0;
  _$jscoverage['base/proxy.js'][16] = 0;
  _$jscoverage['base/proxy.js'][17] = 0;
  _$jscoverage['base/proxy.js'][19] = 0;
  _$jscoverage['base/proxy.js'][22] = 0;
  _$jscoverage['base/proxy.js'][25] = 0;
  _$jscoverage['base/proxy.js'][28] = 0;
  _$jscoverage['base/proxy.js'][31] = 0;
  _$jscoverage['base/proxy.js'][34] = 0;
  _$jscoverage['base/proxy.js'][35] = 0;
  _$jscoverage['base/proxy.js'][36] = 0;
  _$jscoverage['base/proxy.js'][37] = 0;
  _$jscoverage['base/proxy.js'][39] = 0;
  _$jscoverage['base/proxy.js'][42] = 0;
  _$jscoverage['base/proxy.js'][46] = 0;
  _$jscoverage['base/proxy.js'][49] = 0;
  _$jscoverage['base/proxy.js'][52] = 0;
  _$jscoverage['base/proxy.js'][55] = 0;
  _$jscoverage['base/proxy.js'][56] = 0;
  _$jscoverage['base/proxy.js'][59] = 0;
  _$jscoverage['base/proxy.js'][60] = 0;
  _$jscoverage['base/proxy.js'][61] = 0;
  _$jscoverage['base/proxy.js'][63] = 0;
  _$jscoverage['base/proxy.js'][66] = 0;
  _$jscoverage['base/proxy.js'][72] = 0;
  _$jscoverage['base/proxy.js'][73] = 0;
  _$jscoverage['base/proxy.js'][75] = 0;
  _$jscoverage['base/proxy.js'][85] = 0;
  _$jscoverage['base/proxy.js'][86] = 0;
  _$jscoverage['base/proxy.js'][87] = 0;
  _$jscoverage['base/proxy.js'][96] = 0;
  _$jscoverage['base/proxy.js'][97] = 0;
  _$jscoverage['base/proxy.js'][98] = 0;
  _$jscoverage['base/proxy.js'][107] = 0;
  _$jscoverage['base/proxy.js'][108] = 0;
  _$jscoverage['base/proxy.js'][109] = 0;
  _$jscoverage['base/proxy.js'][110] = 0;
  _$jscoverage['base/proxy.js'][112] = 0;
  _$jscoverage['base/proxy.js'][116] = 0;
}
_$jscoverage['base/proxy.js'][1]++;
var Proxy = require("node-proxy"), merge = require("./object").merge;
_$jscoverage['base/proxy.js'][3]++;
var handlerMaker = (function (obj) {
  _$jscoverage['base/proxy.js'][4]++;
  return ({getOwnPropertyDescriptor: (function (name) {
  _$jscoverage['base/proxy.js'][6]++;
  var desc = Object.getOwnPropertyDescriptor(obj, name);
  _$jscoverage['base/proxy.js'][8]++;
  if (desc !== undefined) {
    _$jscoverage['base/proxy.js'][9]++;
    desc.configurable = true;
  }
  _$jscoverage['base/proxy.js'][11]++;
  return desc;
}), getPropertyDescriptor: (function (name) {
  _$jscoverage['base/proxy.js'][14]++;
  var desc = Object.getPropertyDescriptor(obj, name);
  _$jscoverage['base/proxy.js'][16]++;
  if (desc !== undefined) {
    _$jscoverage['base/proxy.js'][17]++;
    desc.configurable = true;
  }
  _$jscoverage['base/proxy.js'][19]++;
  return desc;
}), getOwnPropertyNames: (function () {
  _$jscoverage['base/proxy.js'][22]++;
  return Object.getOwnPropertyNames(obj);
}), getPropertyNames: (function () {
  _$jscoverage['base/proxy.js'][25]++;
  return Object.getPropertyNames(obj);
}), defineProperty: (function (name, desc) {
  _$jscoverage['base/proxy.js'][28]++;
  Object.defineProperty(obj, name, desc);
}), delete: (function (name) {
  _$jscoverage['base/proxy.js'][31]++;
  return delete obj[name];
}), fix: (function () {
  _$jscoverage['base/proxy.js'][34]++;
  if (Object.isFrozen(obj)) {
    _$jscoverage['base/proxy.js'][35]++;
    var result = {};
    _$jscoverage['base/proxy.js'][36]++;
    Object.getOwnPropertyNames(obj).forEach((function (name) {
  _$jscoverage['base/proxy.js'][37]++;
  result[name] = Object.getOwnPropertyDescriptor(obj, name);
}));
    _$jscoverage['base/proxy.js'][39]++;
    return result;
  }
  _$jscoverage['base/proxy.js'][42]++;
  return undefined;
}), has: (function (name) {
  _$jscoverage['base/proxy.js'][46]++;
  return name in obj;
}), hasOwn: (function (name) {
  _$jscoverage['base/proxy.js'][49]++;
  return ({}).hasOwnProperty.call(obj, name);
}), get: (function (receiver, name) {
  _$jscoverage['base/proxy.js'][52]++;
  return obj[name];
}), set: (function (receiver, name, val) {
  _$jscoverage['base/proxy.js'][55]++;
  obj[name] = val;
  _$jscoverage['base/proxy.js'][56]++;
  return true;
}), enumerate: (function () {
  _$jscoverage['base/proxy.js'][59]++;
  var result = [];
  _$jscoverage['base/proxy.js'][60]++;
  for (var name in obj) {
    _$jscoverage['base/proxy.js'][61]++;
    result.push(name);
}
  _$jscoverage['base/proxy.js'][63]++;
  return result;
}), keys: (function () {
  _$jscoverage['base/proxy.js'][66]++;
  return Object.keys(obj);
})});
});
_$jscoverage['base/proxy.js'][72]++;
var noSuchMethodHandler = (function (obj, handler) {
  _$jscoverage['base/proxy.js'][73]++;
  return ({get: (function (receiver, name) {
  _$jscoverage['base/proxy.js'][75]++;
  return obj[name]? obj[name]: handler.call(obj, name);
})});
});
_$jscoverage['base/proxy.js'][85]++;
exports.handlerProxy = (function (obj, opts) {
  _$jscoverage['base/proxy.js'][86]++;
  opts = opts || {};
  _$jscoverage['base/proxy.js'][87]++;
  return Proxy.create(merge(handlerMaker(obj), opts));
});
_$jscoverage['base/proxy.js'][96]++;
exports.methodMissing = (function (obj, handler, opts) {
  _$jscoverage['base/proxy.js'][97]++;
  opts = opts || {};
  _$jscoverage['base/proxy.js'][98]++;
  return Proxy.create(merge(handlerMaker(obj), noSuchMethodHandler(obj, handler)), opts);
});
_$jscoverage['base/proxy.js'][107]++;
exports.createFunctionWrapper = (function (obj, handler, opts) {
  _$jscoverage['base/proxy.js'][108]++;
  var ret = Proxy.createFunction(handlerMaker(obj), handler);
  _$jscoverage['base/proxy.js'][109]++;
  if (opts) {
    _$jscoverage['base/proxy.js'][110]++;
    Proxy.setPrototype(ret, opts);
  }
  _$jscoverage['base/proxy.js'][112]++;
  return ret;
});
_$jscoverage['base/proxy.js'][116]++;
exports.Proxy = Proxy;
_$jscoverage['base/proxy.js'].source = ["var Proxy = require(\"node-proxy\"), merge = require(\"./object\").merge;","","var handlerMaker = function(obj) {","    return {","        getOwnPropertyDescriptor: function(name) {","            var desc = Object.getOwnPropertyDescriptor(obj, name);","            // a trapping proxy's properties must always be configurable","            if (desc !== undefined) {","                desc.configurable = true;","            }","            return desc;","        },","        getPropertyDescriptor:  function(name) {","            var desc = Object.getPropertyDescriptor(obj, name); // not in ES5","            // a trapping proxy's properties must always be configurable","            if (desc !== undefined) {","                desc.configurable = true;","            }","            return desc;","        },","        getOwnPropertyNames: function() {","            return Object.getOwnPropertyNames(obj);","        },","        getPropertyNames: function() {","            return Object.getPropertyNames(obj);                // not in ES5","        },","        defineProperty: function(name, desc) {","            Object.defineProperty(obj, name, desc);","        },","        delete:       function(name) {","            return delete obj[name];","        },","        fix:          function() {","            if (Object.isFrozen(obj)) {","                var result = {};","                Object.getOwnPropertyNames(obj).forEach(function(name) {","                    result[name] = Object.getOwnPropertyDescriptor(obj, name);","                });","                return result;","            }","            // As long as obj is not frozen, the proxy won't allow itself to be fixed","            return undefined; // will cause a TypeError to be thrown","        },","","        has: function(name) {","            return name in obj;","        },","        hasOwn: function(name) {","            return ({}).hasOwnProperty.call(obj, name);","        },","        get: function(receiver, name) {","            return obj[name];","        },","        set: function(receiver, name, val) {","            obj[name] = val;","            return true;","        }, // bad behavior when set fails in non-strict mode","        enumerate:    function() {","            var result = [];","            for (var name in obj) {","                result.push(name);","            }","            return result;","        },","        keys: function() {","            return Object.keys(obj);","        }","","    };","};","","var noSuchMethodHandler = function(obj, handler) {","    return {","        get: function(receiver, name) {","            return obj[name] ? obj[name] : handler.call(obj, name);","        }","    }","};","","/**"," * Creates a proxy for an object."," * @param obj"," * @param opts"," */","exports.handlerProxy = function(obj, opts) {","    opts = opts || {};","    return  Proxy.create(merge(handlerMaker(obj), opts));","};","","/**"," * creates a method missing proxy for an object"," * @param obj"," * @param handler"," * @param opts"," */","exports.methodMissing = function(obj, handler, opts) {","    opts = opts || {};","    return  Proxy.create(merge(handlerMaker(obj), noSuchMethodHandler(obj, handler)), opts);","};","","/**"," * Creates a function proxy for an object."," * @param obj"," * @param handler"," * @param opts"," */","exports.createFunctionWrapper = function(obj, handler, opts) {","    var ret = Proxy.createFunction(handlerMaker(obj), handler);","    if(opts){","        Proxy.setPrototype(ret, opts);","    }","    return ret;","};","","","exports.Proxy = Proxy;"];
