Skip to content

Commit

Permalink
Only use getPrototypeOf if setPrototypeOf is implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed May 18, 2018
1 parent 4a0f40a commit 15aa9c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/babel-helpers/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ helpers.inheritsLoose = () => template.program.ast`

helpers.getPrototypeOf = () => template.program.ast`
export default function _getPrototypeOf(o) {
_getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) {
return o.__proto__;
};
_getPrototypeOf = Object.setPrototypeOf
? Object.getPrototypeOf
: function _getPrototypeOf(o) { return o.__proto__; };
return _getPrototypeOf(o);
}
`;
Expand Down

0 comments on commit 15aa9c2

Please sign in to comment.