Skip to content

Commit

Permalink
Merge pull request #437 from KleeGroup/develop
Browse files Browse the repository at this point in the history
Version 2.2.1
  • Loading branch information
Hartorn authored Feb 5, 2018
2 parents 234cfdd + 7bea144 commit cd74d5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "focus-core",
"version": "2.2.1-beta1",
"version": "2.2.1",
"description": "Focus library core part.",
"main": "index.js",
"babel": {
Expand Down Expand Up @@ -83,4 +83,4 @@
"react-addons-test-utils": "15.4.2",
"react-dom": "15.4.2"
}
}
}
7 changes: 5 additions & 2 deletions src/util/function/rename.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
*/
function renameFunction(func, newName) {
// eslint-disable-next-line no-unused-vars
const { value, ...others } = Object.getOwnPropertyDescriptor(func, 'name');
Object.defineProperty(func, 'name', { value: newName, ...others });
const prop = Object.getOwnPropertyDescriptor(func, 'name');
if (prop) {
const { value, ...others } = prop;
Object.defineProperty(func, 'name', { value: newName, ...others });
}
}

export default renameFunction;

0 comments on commit cd74d5a

Please sign in to comment.