Skip to content

Commit

Permalink
Make Directive | Statement comments meaningful (estree#173)
Browse files Browse the repository at this point in the history
* Make Directive | Statement comments meaningful

Because a Directive is an ExpressionStatement and an ExpressionStatement is a Statement, the use of Directive | Statement option was redundant. This change attempts to capture the intent of the Directive | Statement, by making it clear that while Directive is structurally a subtype of ExpressionStatement, the directive type is not a valid addition to any ExpressionStatement, just ones that are children of a Function or Program.

* Make Directive hold only Literal expressions.

At the suggestion of @RReverser, express the further refinement that the subexpression of a Directive is always a Literal.
  • Loading branch information
robsimmons authored and mikesherov committed Oct 5, 2017
1 parent 0832c64 commit 1da8e60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion es5.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ An expression statement, i.e., a statement consisting of a single expression.
## Directive

```js
interface Directive <: ExpressionStatement {
interface Directive <: Node {
type: "ExpressionStatement";
expression: Literal;
directive: string;
}
```
Expand Down

0 comments on commit 1da8e60

Please sign in to comment.