Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
new.target
with shadowed class name (#14611)
- Loading branch information
1 parent
a5dacd9
commit facafc3
Showing
5 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../babel-plugin-transform-new-target/test/fixtures/general/function-duplicate-name/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function Foo() { | ||
function Foo() { | ||
var Foo = new.target; | ||
} | ||
|
||
Foo.prototype.test = function() { | ||
var Foo = new.target; | ||
}; | ||
} | ||
|
||
var Bar = function() { | ||
var Bar = new.target; | ||
}; |
13 changes: 13 additions & 0 deletions
13
...babel-plugin-transform-new-target/test/fixtures/general/function-duplicate-name/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function Foo() { | ||
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; | ||
}; | ||
} | ||
|
||
var Bar = function _target2() { | ||
var Bar = this instanceof _target2 ? this.constructor : void 0; | ||
}; |