Skip to content

Commit

Permalink
prevent usage polyfilled Reflect.construct in wrapNativeSuper hel…
Browse files Browse the repository at this point in the history
…per, see #7533
  • Loading branch information
zloirock committed Apr 4, 2018
1 parent 73c8afa commit 178ffb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-helpers/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,13 @@ helpers.wrapNativeSuper = () => template.program.ast`
return _sPO(o, p);
}
function _construct(Parent, args, Class) {
_construct = (typeof Reflect === "object" && Reflect.construct) ||
_construct = typeof Reflect !== "object" || !Reflect.construct || Reflect.construct.sham ?
function _construct(Parent, args, Class) {
var Constructor, a = [null];
a.push.apply(a, args);
Constructor = Parent.bind.apply(Parent, a);
return _sPO(new Constructor, Class.prototype);
};
} : Reflect.construct;
return _construct(Parent, args, Class);
}
Expand Down

0 comments on commit 178ffb1

Please sign in to comment.