Skip to content

Commit

Permalink
Add check for defineProperty and getOwnPropertyDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Nov 18, 2017
1 parent 25fb92b commit ebad225
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/babel-helpers/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,9 @@ helpers.interopRequireWildcard = defineHelper(`
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.getOwnPropertyDescriptor(obj, key);
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key)
: {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
Expand Down

0 comments on commit ebad225

Please sign in to comment.