Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed May 28, 2022
1 parent f15cf3f commit 1b280bd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/babel-plugin-transform-new-target/src/index.ts
Expand Up @@ -53,6 +53,7 @@ export default declare(api => {
// packages/babel-helper-create-class-features-plugin/src/fields.ts#L192 unshadow
let scope = path.scope;
while (
scope !== func.parentPath.scope &&
scope?.hasBinding(node.id.name) &&
!scope.bindingIdentifierEquals(node.id.name, node.id)
) {
Expand Down
@@ -1,10 +1,12 @@
function Foo() {
var Foo = new.target;
}
function Foo() {
var Foo = new.target;
}

Foo.prototype.test = function() {
var Foo = new.target;
};
Foo.prototype.test = function() {
var Foo = new.target;
};
}

var Bar = function() {
var Bar = new.target;
Expand Down
@@ -1,10 +1,12 @@
function Foo() {
var _Foo = this instanceof Foo ? this.constructor : void 0;
}
function Foo() {
var _Foo = this instanceof Foo ? this.constructor : void 0;
}

Foo.prototype.test = function _target() {
var Foo = this instanceof _target ? this.constructor : void 0;
};
Foo.prototype.test = function _target() {
var Foo = this instanceof _target ? this.constructor : void 0;
};
}

var Bar = function _target2() {
var Bar = this instanceof _target2 ? this.constructor : void 0;
Expand Down

0 comments on commit 1b280bd

Please sign in to comment.