Skip to content

Commit

Permalink
Add OptId{Class,Function}Declaration for ExportDefaultDeclaration
Browse files Browse the repository at this point in the history
Closes estree#98. This implementation was initially suggested by Sebastian McKenzie.
  • Loading branch information
adrianheine committed Nov 13, 2017
1 parent 1da8e60 commit 347a713
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion es2015.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This document specifies the extensions to the [core ESTree AST types](es5.md) to

- [Programs](#programs)
- [Functions](#functions)
- [OptIdFunctionDeclaration](#optidfunctiondeclaration)
- [Statements](#statements)
- [ForOfStatement](#forofstatement)
- [Declarations](#declarations)
Expand All @@ -26,6 +27,7 @@ This document specifies the extensions to the [core ESTree AST types](es5.md) to
- [ClassDeclaration](#classdeclaration)
- [ClassExpression](#classexpression)
- [MetaProperty](#metaproperty)
- [OptIdClassDeclaration](#optidclassdeclaration)
- [Modules](#modules)
- [ModuleDeclaration](#moduledeclaration)
- [ModuleSpecifier](#modulespecifier)
Expand Down Expand Up @@ -61,6 +63,13 @@ extend interface Function {
}
```

## OptIdFunctionDeclaration

```js
interface OptIdFunctionDeclaration <: FunctionDeclaration {
id: Identifier | null;
}

# Statements

## ForOfStatement
Expand Down Expand Up @@ -299,6 +308,14 @@ interface MetaProperty <: Expression {
}
```
## OptIdClassDeclaration
```js
interface OptIdClassDeclaration <: ClassDeclaration {
id: Identifier | null;
}
```
# Modules
## ModuleDeclaration
Expand Down Expand Up @@ -397,7 +414,7 @@ An exported variable binding, e.g., `{foo}` in `export {foo}` or `{bar as foo}`
```js
interface ExportDefaultDeclaration <: ModuleDeclaration {
type: "ExportDefaultDeclaration";
declaration: Declaration | Expression;
declaration: OptIdFunctionDeclaration | OptIdClassDeclaration | Expression;
}
```
Expand Down

0 comments on commit 347a713

Please # to comment.