Skip to content

Commit

Permalink
Merge pull request #19 from sebmck/classes
Browse files Browse the repository at this point in the history
Add ES6 class definitions
  • Loading branch information
sebmck committed Feb 15, 2015
2 parents 4c83c84 + babcb29 commit f30253e
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions es6.md
Expand Up @@ -89,3 +89,52 @@ interface ArrayPattern <: Pattern {
elements: [ Pattern | null ];
}
```

# Classes

```js
interface Class <: Node {
id: Identifier | null;
superClass: Expression;
body: ClassBody;
}
```

## ClassBody

```js
interface ClassBody <: Node {
type: "ClassBody";
body: [ MethodDefinition ];
}
```

## MethodDefinition

```js
interface MethodDefinition <: Node {
type: "MethodDefinition";
key: Identifier;
value: FunctionExpression;
kind: "" | "get" | "set";
computed: boolean;
static: boolean;
}
```

## ClassDeclaration

```js
interface ClassDeclaration <: Class, Declaration {
type: "ClassDeclaration";
id: Identifier;
}
```

## ClassExpression

```js
interface ClassExpression <: Class, Expression {
type: "ClassExpression";
}
```

0 comments on commit f30253e

Please sign in to comment.