Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deconflict top-level class and function expressions with ids (#2458)
- Loading branch information
1 parent
cdfd279
commit d9b479d
Showing
12 changed files
with
62 additions
and
2 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
3 changes: 3 additions & 0 deletions
3
test/function/samples/deconflict-default-exported-named-function/_config.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,3 @@ | ||
module.exports = { | ||
description: 'deconflict default exported named function and class expressions' | ||
}; |
5 changes: 5 additions & 0 deletions
5
test/function/samples/deconflict-default-exported-named-function/classDeclaration1.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,5 @@ | ||
export default class test { | ||
constructor() { | ||
this.name = 'classDeclaration1'; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
test/function/samples/deconflict-default-exported-named-function/classDeclaration2.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,5 @@ | ||
export default class test { | ||
constructor() { | ||
this.name = 'classDeclaration2'; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
test/function/samples/deconflict-default-exported-named-function/classExpression1.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,5 @@ | ||
export default (class test { | ||
constructor() { | ||
this.name = 'classExpression1'; | ||
} | ||
}) |
5 changes: 5 additions & 0 deletions
5
test/function/samples/deconflict-default-exported-named-function/classExpression2.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,5 @@ | ||
export default (class test { | ||
constructor() { | ||
this.name = 'classExpression2'; | ||
} | ||
}) |
3 changes: 3 additions & 0 deletions
3
test/function/samples/deconflict-default-exported-named-function/functionDeclaration1.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,3 @@ | ||
export default function test() { | ||
return 'functionDeclaration1'; | ||
}; |
3 changes: 3 additions & 0 deletions
3
test/function/samples/deconflict-default-exported-named-function/functionDeclaration2.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,3 @@ | ||
export default function test() { | ||
return 'functionDeclaration2'; | ||
}; |
3 changes: 3 additions & 0 deletions
3
test/function/samples/deconflict-default-exported-named-function/functionExpression1.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,3 @@ | ||
export default (function test() { | ||
return 'functionExpression1'; | ||
}); |
3 changes: 3 additions & 0 deletions
3
test/function/samples/deconflict-default-exported-named-function/functionExpression2.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,3 @@ | ||
export default (function test() { | ||
return 'functionExpression2'; | ||
}); |
19 changes: 19 additions & 0 deletions
19
test/function/samples/deconflict-default-exported-named-function/main.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,19 @@ | ||
import ClassDeclaration1 from './classDeclaration1'; | ||
import ClassDeclaration2 from './classDeclaration2'; | ||
import ClassExpression1 from './classExpression1'; | ||
import ClassExpression2 from './classExpression2'; | ||
import functionDeclaration1 from './functionDeclaration1'; | ||
import functionDeclaration2 from './functionDeclaration2'; | ||
import functionExpression1 from './functionExpression1'; | ||
import functionExpression2 from './functionExpression2'; | ||
import { test } from './named.js'; | ||
|
||
assert.equal(test(), 'named'); | ||
assert.equal(functionDeclaration1(), 'functionDeclaration1'); | ||
assert.equal(functionDeclaration2(), 'functionDeclaration2'); | ||
assert.equal(functionExpression1(), 'functionExpression1'); | ||
assert.equal(functionExpression2(), 'functionExpression2'); | ||
assert.equal((new ClassDeclaration1()).name, 'classDeclaration1'); | ||
assert.equal((new ClassDeclaration2()).name, 'classDeclaration2'); | ||
assert.equal((new ClassExpression1()).name, 'classExpression1'); | ||
assert.equal((new ClassExpression2()).name, 'classExpression2'); |
3 changes: 3 additions & 0 deletions
3
test/function/samples/deconflict-default-exported-named-function/named.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,3 @@ | ||
export const test = function() { | ||
return 'named'; | ||
}; |