diff --git a/index.js b/index.js index 92aa90f..c1ea0ec 100644 --- a/index.js +++ b/index.js @@ -22,18 +22,23 @@ module.exports = function overrideFn(context, fnName, fn) { return fn.apply(this, params); }; - Object.defineProperties(context[fnName], { - length: { - get: function () { - return baseFn.length; + try { + Object.defineProperties(context[fnName], { + length: { + get: function () { + return baseFn.length; + } + }, + name: { + get: function () { + return baseFn.name; + } } - }, - name: { - get: function () { - return baseFn.name; - } - } - }); + }); + } + catch (ex) { + console.warn(ex); + } context[fnName].toString = function () { return baseFn.toString(); diff --git a/package.json b/package.json index c5ab795..7cc19c1 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,14 @@ }, "keywords": [ "override", + "function", + "override function", "override fn", "override-fn", "overrideFn", "massive", "massive-angular", - "massive angular", - "massiveAngular" + "massive angular" ], "license": "MIT", "bugs": {