Skip to content

Commit

Permalink
PrivateName => PrivateIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jun 8, 2020
1 parent 19f342e commit 04a2841
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions experimental/class-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ extend interface ClassBody {
```js
interface PropertyDefinition <: Node {
type: "PropertyDefinition";
key: Expression | PrivateName;
key: Expression | PrivateIdentifier;
value: Expression | null;
computed: boolean;
static: boolean;
private: boolean;
}
```

- When `private` is `true`, `computed` must be `false` and `key` must be a `PrivateName`.
- When `private` is `false`, `key` must be an `Expression` and can not be a `PrivateName`.
- When `private` is `true`, `computed` must be `false` and `key` must be a `PrivateIdentifier`.
- When `private` is `false`, `key` must be an `Expression` and can not be a `PrivateIdentifier`.

## MethodDefinition

```js
extend interface MethodDefinition {
key: Expression | PrivateName;
key: Expression | PrivateIdentifier;
private: boolean;
}
```

- When `private` is `true`, `computed` must be `false`, `key` must be a `PrivateName`, `kind` can not be `"constructor"`.
- When `private` is `false`, `key` must be an `Expression` and can not be a `PrivateName`.
- When `private` is `true`, `computed` must be `false`, `key` must be a `PrivateIdentifier`, `kind` can not be `"constructor"`.
- When `private` is `false`, `key` must be an `Expression` and can not be a `PrivateIdentifier`.

### PrivateName
### PrivateIdentifier

```js
interface PrivateName <: Node {
type: "PrivateName";
interface PrivateIdentifier <: Node {
type: "PrivateIdentifier";
name: string;
}
```
Expand All @@ -54,12 +54,12 @@ A private name refers to private class elements. For a private name `#a`, its `n
```js
extend interface MemberExpression {
private: boolean;
property: Expression | PrivateName;
property: Expression | PrivateIdentifier;
}
```

- When `private` is `true`, `property` must be a `PrivateName`, `computed` must be `false`.
- When `private` is `false`, `property` must be an `Expression` and can not be a `PrivateName`.
- When `private` is `true`, `property` must be a `PrivateIdentifier`, `computed` must be `false`.
- When `private` is `false`, `property` must be an `Expression` and can not be a `PrivateIdentifier`.
- When `object` is a `Super`, `private` must be `false`.

[Class Fields]: https://github.com/tc39/proposal-class-fields
Expand Down
4 changes: 2 additions & 2 deletions experimental/private-fields-in-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

```js
extend interface BinaryExpression <: Expression {
left: Expression | PrivateName;
left: Expression | PrivateIdentifier;
}
```

- `left` can be a private name (e.g. `#foo`) when `operator` is `"in"`.
- `left` can be a private identifier (e.g. `#foo`) when `operator` is `"in"`.

[proposal-private-fields-in-in]: https://github.com/tc39/proposal-private-fields-in-in

0 comments on commit 04a2841

Please sign in to comment.