Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid name conflicts for default exported classes (#4756)
* Avoid name conflicts for default exported classes * Improve coverage
- Loading branch information
1 parent
ffab4cd
commit a27cf81
Showing
14 changed files
with
51 additions
and
0 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,3 @@ | ||
module.exports = { | ||
description: 'does not shadow variables when preserving class names' | ||
}; |
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 @@ | ||
export default class Foo {} |
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,14 @@ | ||
import Bar from './foo'; | ||
|
||
const wrapper = () => { | ||
class Foo extends Bar { | ||
static assertName() { | ||
assert.strictEqual(this.name, 'Foo'); | ||
assert.strictEqual(super.name, 'Foo'); | ||
} | ||
} | ||
|
||
return Foo; | ||
}; | ||
|
||
wrapper().assertName(); |
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,3 @@ | ||
module.exports = { | ||
description: 'does not shadow variables when preserving class names' | ||
}; |
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,5 @@ | ||
var Foo = class {}; | ||
|
||
export default Foo; | ||
|
||
Foo = 'reassigned'; |
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,14 @@ | ||
import Bar from './reexport'; | ||
|
||
const wrapper = () => { | ||
class Foo extends Bar { | ||
static assertName() { | ||
assert.strictEqual(this.name, 'Foo'); | ||
assert.strictEqual(super.name, 'Foo'); | ||
} | ||
} | ||
|
||
return Foo; | ||
}; | ||
|
||
wrapper().assertName(); |
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,2 @@ | ||
import Foo from './foo'; | ||
export default Foo; |