-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for 'export default' with expressions
- Loading branch information
1 parent
a0eff60
commit 0e8b6df
Showing
7 changed files
with
48 additions
and
42 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
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 |
---|---|---|
|
@@ -933,7 +933,8 @@ module ts { | |
export type ExportSpecifier = ImportOrExportSpecifier; | ||
|
||
export interface ExportAssignment extends Statement, ModuleElement { | ||
exportName: Identifier; | ||
This comment has been minimized.
Sorry, something went wrong.
CyrusNajmabadi
Contributor
|
||
isExportEquals?: boolean; | ||
expression: Expression; | ||
} | ||
|
||
export interface FileReference extends TextRange { | ||
|
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
14 changes: 7 additions & 7 deletions
14
tests/cases/conformance/externalModules/exportAssignNonIdentifier.ts
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
// @Filename: foo1.ts | ||
var x = 10; | ||
export = typeof x; // Error | ||
export = typeof x; // Ok | ||
|
||
// @Filename: foo2.ts | ||
export = "sausages"; // Error | ||
export = "sausages"; // Ok | ||
|
||
// @Filename: foo3.ts | ||
export = class Foo3 {}; // Error | ||
export = class Foo3 {}; // Error, not an expression | ||
|
||
// @Filename: foo4.ts | ||
export = true; // Error | ||
export = true; // Ok | ||
|
||
// @Filename: foo5.ts | ||
export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript | ||
|
||
// @Filename: foo6.ts | ||
export = void; // Error | ||
export = void; // Error, void operator requires an argument | ||
|
||
// @Filename: foo7.ts | ||
export = Date || String; // Error | ||
export = Date || String; // Ok | ||
|
||
// @Filename: foo8.ts | ||
export = null; // Error | ||
export = null; // Ok | ||
|
This seems like a somewhat odd constant value. Coudl this be a problem if someone actually names something
"*default*"
(i.e.with a string literal) somewhere in their code?