Skip to content

Commit

Permalink
Directly use arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Feb 1, 2020
1 parent 0714b36 commit af5fc16
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/babel-helpers/src/helpers.js
Expand Up @@ -744,12 +744,9 @@ helpers.createSuper = helper("7.9.0")`
return function () {
var Super = getPrototypeOf(Derived), result;
if (isNativeReflectConstruct()) {
for (var l = arguments.length, args = new Array(l), i = 0; i < l; i++) {
args[i] = arguments[i];
}
// NOTE: This doesn't work if this.__proto__.constructor has been modified.
var NewTarget = getPrototypeOf(this).constructor;
result = Reflect.construct(Super, args, NewTarget);
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
Expand Down

0 comments on commit af5fc16

Please sign in to comment.